User Pass
Home Sign Up Contact Log In
Forum > Goal Line Blitz > Greasemonkey Scripts > Greasemonkey Scripts On Chrome FAQ
numone
offline
Link
 
Do Greasemonkey Scripts Work In Chrome?
Yes and no. Basic scripts will work in Chrome, however, any script that uses any of the GM functions (GM_getVal, GM_setVal, etc) will not work in Chrome natively. Also any script that uses the @require attribute wont work natively in Chrome, this includes any script that uses jquery. There is many other things that will stop it from working in Chrome but those are the most common reasons why.


What do you mean by natively?
There is an extension for Chrome called tampermonkey ( https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en ) which tries to bridge the gap and the two examples mentioned earlier will now work. I've had a lot of issues with this, though, stopping scripts on GLB from running. I have not taken the time to figure out why though. If this extension can fix that flaw it will go a long way towards nearly identical functionality.


What else can be done to get script xxx working in Chrome?
The best thing you can do is convert it to a Chrome Extension ( http://code.google.com/chrome/extensions/getstarted.html ). At the 2010 Google I/O event they did a pretty good job of going through creating extensions. That video can be found here ( http://www.youtube.com/watch?v=iVSR6gufMXI ). A greasemonkey script would be nothing more then a content script ( http://code.google.com/chrome/extensions/content_scripts.html ).

Of course there is still limitations such as you cannot access local javascript variables on the page, this is for security reasons, however it also makes scripts such as replay rewrite nearly impossible to export to Chrome.


Where can I get an example of an existing Chrome extension to look at?
I have written a very simple one here ( https://chrome.google.com/webstore/detail/baflmmkccopaofoegnchkdfgagoadplp ). If you go ahead and install it you can see the source code located in C:\Users\{username}\AppData\Local\Google\Chrome\User Data\Default\Extensions\baflmmkccopaofoegnchkdfgagoadplp\{current version}\ (note:AppData is a hidden folder, you will need to show hidden folders).


Let me know if there's anything else you would like added to this.
 
dmfa41
offline
Link
 
Thank you for helping the community.
 
Sugar Kapaa
\m/
offline
Link
 
 
Sugar Kapaa
\m/
offline
Link
 
https://chrome.google.com/webstore/search?q=GLB
 
Jampy2.0
thuggin'
offline
Link
 
 


You are not logged in. Please log in if you want to post a reply.