问题
I have script like this
// ==UserScript==
// @name messi
// @namespace http://messi.com
// @description example script to alert "barcelona" on userscripts page
// @include http://userscripts.org/*
// ==/UserScript==
alert('barcelona');
this script works with Greasemonkey.
I compiled this script using this link:
https://arantius.com/misc/greasemonkey/script-compiler.php.
After compilation I added add-on to Firefox, now it showing:
Error: Illegal operation on WrappedNative prototype objec error .
whats wrong ?
回答1:
The user script compiler wasn't updated in quite some time and the output add-ons it produces stopped working in recent Firefox versions IIRC.
If you want to create Firefox add-ons from userscripts, you should consider using the Add-on SDK and making your user-script a page mod. That is what the addons.mozilla.org editor team is recommending, anyway.
There are other alternatives, such as Scriptify.
来源:https://stackoverflow.com/questions/20324365/greasemonkey-script-compiler-is-showing-an-error