/ Published in: JavaScript
URL: http://wiki.github.com/Martii/greasemonkey/location-hack
Runs a function from the address bar (like a bookmarklet). This can be used in Greasemonkey scripts to get around an XPCNativeWrapper object without accessing unsafeWindow.
Expand |
Embed | Plain Text
/**************************************** Runs a function from the address bar (like a bookmarklet). This can be used in Greasemonkey scripts to get around an XPCNativeWrapper object without accessing unsafeWindow. Based on http://wiki.github.com/Martii/greasemonkey/location-hack /****************************************/ function runLocationHack(func) { location.href = 'javascript:(function(){('+encodeURI(func)+')()})()'; }
You need to login to post a comment.
