有没有办法在Chrome的JavaScript控制台中使用Tampermonkey's API?
我想弄乱GM_xmlhttpRequest()
和GM_listValues()
之类的功能。
最佳答案
// ==UserScript==
// @name Exports some GM functions
// @namespace Whatever
// @match *
// ==/UserScript==
// WARNING: Any page can now use these methods! Be careful,
// or change "@match *" to "@match https://example.com" and
// visit https://example.com to test the API.
unsafeWindow.GM_xmlhttpRequest = GM_xmlhttpRequest;
unsafeWindow.GM_listValues = GM_listValues;