2012-08-29 17 views
3

我寫了我的第一個腳本Greasemonkey,它工作的很好,除了它正在返回exposedProps錯誤,它正在處理的每個頁面。我已經修復了所有其他錯誤,但這個仍然存在,並且基於網絡上的一些文章(如this),它將在Firefox 17發佈時打破我的腳本。 (現在,我使用的是Firefox 15.0,幸好它只是返回一個警告錯誤!)如何修復Greasemonkey上的__exposedProps__錯誤(GM_xmlhttpRequest)?

我在我的腳本中使用GM_xmlhttpRequest:

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,""); 

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

,這是指的是線路錯誤消息我把箭頭在前面:

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 

我發現這個page,它提供了一個解決這個錯誤,但老實說,我想不通我怎麼能在這裏使用它!

我真的很感激你的所有幫助提前... 並感謝您的時間!

+0

你正在使用什麼Greasemonkey版本?您是注入任何代碼還是創建'

相關問題