这是完整的脚本:
// ==UserScript==
// @name Mirror Page
// @namespace mailto:linkhyrule5@gmail.com
// @description POSTs page to dynamic page mirror
// @include http://www.google.com
// @version 1
// @grant GM_xmlhttpRequest
// @grant GM_info
// ==/UserScript==
console.log(GM_info);
var ihtml = document.body.innerHTML;
GM_xmlhttpRequest({
method:'POST',
url:'http://localhost:5723/index.php',
data:"PageContents=" + escape(ihtml) + "\nURL=" + escape(document.URL),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
});
Google主页上的让我
/*
Exception: ReferenceError: GM_info is not defined
@Scratchpad/1:11:1
*/
以及之前的GM_xmlhttpRequest is not defined
。
在Firefox 45.0上运行GreaseMonkey 3.7。我重新启动了Firefox并启用/禁用了;该脚本纯粹存在于我的剪贴板和沙盒中,但是在“删除脚本并从剪贴板重新创建它”的情况下,我还重新安装了脚本。
我现在尝试将文件复制到.user.js文件并从那里安装;仍然不起作用。