如何修复Greasemonkey上的__exposedProps_错误(GM_xmlhttpRequest)
How to fix __exposedProps__ error on Greasemonkey (GM_xmlhttpRequest)?
我已经为Greasemonkey编写了我的第一个脚本,它运行得很好,只是它在处理的每个页面中都返回了exposedProps错误。我已经修复了所有其他错误,但这个错误仍然存在,并且基于网络上的一些文章(比如这样),它将在未来Firefox 17发布时破坏我的脚本。(现在我使用的是Firefox 15.0,幸运的是它只返回了一个警告错误!)
我在脚本中使用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
我找到了这个页面,它为这个错误提供了解决方案,但老实说,我不知道如何在这里使用它!
我真的很感谢你提前提供的帮助。。。感谢您抽出时间!
这是Greasemonkey内部的一个问题/潜在错误。参见:
- 问题#1595,"使用exposedProps"
- Issue#1607,"GM_xmlhttpRequest response.responseText在Nightly17.0a1中未定义…"
您可能需要权衡并跟踪这些错误报告。
如果您链接到完整脚本,我们可能会帮助您解决问题,但很可能,它只能在Greasemonkey内部修复。
相关文章:
- XMLHttpRequest未返回值-状态202
- XMLHttpRequest在移动设备上的chrome上不起作用
- AJAX简单错误.XMLHttpRequest无法加载http://localhost/mpl/getPage.php.
- 检查xmlhttprequest问题的消息
- 主线程上的同步XMLHttpRequest已弃用
- 如何定期发出xmlhttprequest
- javascript第三个XMLHttpRequest被拒绝.但前两个是允许的
- 上传带有XMLHttprequest的文件-多部分/表单数据中缺少边界
- 对象#<XMLHttpRequest>没有方法'完成'
- 在XMLHttpRequest之后重新初始化jQuery
- 如何将GreaseMonkey中的XMLHttpRequest延迟到目标页面加载完成
- Javascript XMLHttpRequest——只有第一个POST请求有效
- XMLHttpRequest - difference between Chrome & Firefox
- IE上的新XMLHttpRequest()出现JS Ajax未指定错误
- 非常简单的XMLHttpRequest不起作用
- 如何使用XMLHttpRequest下载文件
- XMLHttpRequest在$.ajax工作的地方给出了CORS错误
- XMLHttpRequest.open()AJAX中的参数url
- 使用GM-xmlhttpRequest而不是iframe来显示来自外部页面的相关信息
- 将@grant添加到GM脚本中可以打破XMLHttpRequest.prototype.open的过载