how to Use the Tampermonkey API from the Chrome console

 

1.Create the following script:

 

// ==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;

2.Open any page where Tampermonkey can be activated ( http://stackoverflow.com/ for instance).

3.Open the Developer tools -> Console.

4.Done, you can now do whatever you want with the exported methods (from step 1).

posted @ 2017-03-06 13:54  一个勤奋的胖子  阅读(375)  评论(0编辑  收藏  举报