油猴脚本如何在浏览器中发送跨域请求url?
网友回复
这是我们要引用
// @grant GM_xmlhttpRequest之后我们的代码中就可以使用GM_xmlhttpRequest函数了
之后我们的代码中就可以使用GM_xmlhttpRequest函数了 // ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.bfw.wiki // @grant GM_xmlhttpRequest // @grant GM_download // ==/UserScript== /* jshint -W097 */ 'use strict'; GM_xmlhttpRequest({ method: "GET", url: "http://www.qq.com/", onload: function(response) { //这里写处理函数 } });