Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 01-03-2011, 10:20 PM   #1 (permalink)
Your Ad here
 
nisargshah95's Avatar
 
Join Date: Feb 2010
Location: Mahesana, Gujarat, India
Posts: 326
Exclamation Help debugging my first GM script


Hi,
I'm really new to programming and created a small Greasemonkey script for disabling the theater view for viewing photos in Facebook. But its not working.
The basic principle I applied was to remove the '&theater' parameter at the end of every photo URL. Hope this gets fixed soon.
Here's the code -


Code:
// ==UserScript==
// @name           Kill The Theater
// @namespace      http://www.userscripts.org/
// @description    Disable theater view in Facebook
// @include        http://*.facebook.com/*
// @include        https://*.facebook.com/*
// @exclude        https://www.facebook.com/home.php
// @version        0.2b 

// ==/UserScript==

var url=window.location.href;
var condition=url.match("&theater");
if (condition=="&theater")          
     {
      url=url.replace("&theater", "");
      window.location.href=url;
     }
I tested it by embedding it in a standard HTML file and running it locally. But it doesn't work for facebook. I think there's some issue with XPCNativeWrapper.

Thanks in advance.
__________________
Quote:
“The Web is like a dominatrix. Everywhere I turn, I see little buttons ordering me to Submit.”
ASUS P5KPL AM/PS | P4 @ 3.07GHz | Ubuntu 11.04 / Win Server 2k8 / XP SP3 | 1GB DDR2 | Samsung HD080HJ 80GB

Last edited by nisargshah95; 10-03-2011 at 11:07 AM. Reason: Updated code
nisargshah95 is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx
- by clinton

Advertisement




All times are GMT +5.5. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2