unsafeWindow无法挪用GM_getValue和GM_setValue的题目
因为定名空间改变,unsafeWindow下无法挪用GM_getValue和GM_setValue如下 //行使正常 GM_setValue(‘foo’,true); GM_etValue(‘foo’); //不能会见GM值的 $(“#btnPost”).click(function(){ GM_setValue(‘foo’,true);//此时无法配置值 GM_etValue(‘foo’);//这里也得不到值 //可以行使以下要领办理 //表面套一个setTimeout() setTimeout(function(){ GM_setValue(‘foo’,true);//可以写入值 GM_etValue(‘foo’);//可以获得值 },0) }) 办理方案来历与官方文档 http://wiki.greasespot.net/0.7.20080121.0_compatibility 但愿对你有效。Enjoy it. http://www.radys.cn/article.asp?id=295 (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |