3

I have written my first script for Greasemonkey, it is working great, except that it is returning exposedProps error in each page it is working on. I already fixed all other errors but this one is still there and based on some articles on web (like this) it will break my script in the future when Firefox 17 is published. (Right now I'm using Firefox 15.0 and fortunately it just returns a warning error!)

I'm using GM_xmlhttpRequest in my script:

function doProcess(id, in_process_type){

    var set_id = GM_getValue("pid"+id);

    GM_xmlhttpRequest({
        method: "POST",
        url: "https://website_address/return_params.php",
        data: "pid="+set_id,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        onload: function(response) {
    --->    var params = response.responseText;
            params = params.replace(/(\r\n|\n|\r|\s)/gm,"");

            ..........
        }
    });
}

and this is error message that refers to the line that I put an arrowhead in front of it:

Error: Exposing chrome JS objects to content without __exposedProps__ is insecure and deprecated. See https://developer.mozilla.org/en/XPConnect_wrappers for more information.
Source File: file:///Users/Mona/Library/Application%20Support/Firefox/Profiles/tonfd656.default/gm_scripts/MonaTest/MonaTest.user.js
Line: 133 

I found this page, that offers a solution to this error, but honestly I can't figure out how I can use it here!

I really appreciate all your help in advance... And thanks for your time!

Mona
  • 788
  • 3
  • 13
  • 18
  • What Greasemonkey version are you using? Are you injecting any code or creating ` – Brock Adams Aug 30 '12 at 00:22
  • @BrockAdams I have Greasemonkey Version 1.0 installed on my ff, I think it is the latest version, isn't it?! – Mona Aug 30 '12 at 15:51
  • I also included a remote JS file via direct code injection, but this function doesn't do anything with that script... – Mona Aug 30 '12 at 15:58
  • Yes, 1.0 is the latest GM release. I asked that before realizing that this problem likely affects all current Greasemonkey versions, anyway. – Brock Adams Aug 30 '12 at 16:27

1 Answers1

3

This is a problem / potential-bug within Greasemonkey itself. See:

You might want to weigh-in and track those bug reports.

If you link to your complete script, we might be able to help with a workaround but, most likely, it can only be fixed within Greasemonkey itself.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • I tried "use an explicit function", and it didn't work. so I guess we wait for Greasemonkey's fix. – Wooooo Aug 30 '12 at 12:55
  • @BrockAdams Thanks for the links, I added them to my watch list... I tried your solution too, and it returned same error in function processResponse... I guess I wait for gm fix too... anyway thanks for your time! (The only reason I didn't accept your answer is because of the code that can't fix the issue, but if you remove that part I will accept it, because of the links and the point that it is a GM issue...) – Mona Aug 30 '12 at 16:30
  • Okay, I removed the suggested experiment since that's 2 reports that it didn't work. ... Note that you could/can edit the answer (or most anything) yourself. It goes into a suggested-edit queue, but most all SE's are approved unless they're really bad. – Brock Adams Aug 30 '12 at 16:35