`// ==UserScript==
// @name demo1
// @namespace https://www.csdn.net/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @connect www.csdn.net
// @match https://www.csdn.net/*
// @grant unsafewindow
// @grant GM_info
// @grant GM_xmlhttpRequest
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_setClipboard
// @grant GM_download
// @grant GM_openInTab
// @grant GM_listValues
// @grant GM_cookie
// ==/UserScript==
(function() {
'use strict';
// Your code here...
unsafeWindow.GM_info=GM_info;
unsafeWindow.GM_xmlhttpRequest=GM_xmlhttpRequest;
unsafeWindow.GM_setValue=GM_setValue;
unsafeWindow.GM_getValue=GM_getValue;
unsafeWindow.GM_openInTab=GM_openInTab;
unsafeWindow.GM_download=GM_download;
unsafeWindow.GM_openInTab=GM_openInTab;
unsafeWindow.GM_listValues=GM_listValues;
unsafeWindow.GM_cookie_=GM_cookie;
GM_cookie("list", {
domain: window.location.host
}, (cookies) => {
console.log("domain", cookies);
});
})();`
代码如上
打开网页后会输出cookie信息
api函数好像也能显示出来
但是为什么复制这个输出的代码不能运行??