文章标签 ‘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.
分类: 后端
标签: GM_getValue, GM_setValue
