javascriptfirefox-addongreasemonkey

Illegal operation in Greasemonkey script compiler


I have a Greasemonkey script and I'm using a Greasemonkey to xpi compiler

I use this script:

// ==UserScript==
// @name           Teste Script
// @author         Bla
// ==/UserScript==

var Main = setInterval(
    function () {
        alert(window.location.href);
    }, 1000);

and when I install the xpi, I keep getting this error:

Error: Illegal operation on WrappedNative prototype object

Already tried window.alert and it still shows the same error.


Solution

  • Well, It looks like the converter is somehow broken.

    If i take an hello world script with this content:

    // ==UserScript==
    // @name          Webmonkey's Hello World
    // @namespace     http://www.webmonkey.com
    // @description   A basic example of Greasemonkey that causes an alert at each page load.
    // @include       *
    // ==/UserScript==
    
    
    alert('Monkey sez... "Hello World!"');
    

    The error is still there. So i don't suspect that your code is the problem, more the compiler.

    I've never created an XPI by myself, but i think that you should try it by hand and see if that works. Perhaps will this problem be fixed in the future ( watch his github page for updates )