Skip to content

Instantly share code, notes, and snippets.

@to
Created March 26, 2011 09:17
Show Gist options
  • Save to/888157 to your computer and use it in GitHub Desktop.
Save to/888157 to your computer and use it in GitHub Desktop.
environment.greasemonkey.js
connect(grobal, 'environment-load', function(){
var gm = Cc['@greasemonkey.mozdev.org/greasemonkey-service;1'];
if(gm){
gm = gm.getService().wrappedJSObject;
addBefore(gm, 'evalInSandbox', function(){
for(var i=0, len=arguments.length ; i<len ; i++){
var arg = arguments[i];
if(typeof(arg) == 'object'){
arg.GM_addStyle = function(){
alert('patched');
};
return;
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment