// ==UserScript== // @name postmsg // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.1 // @description gp up down // @author wl626 // @grant GM_xmlhttpRequest // @grant GM_notification // @grant GM_cookie // @grant GM_log // ==/UserScript== function postmsg(url,content){ GM_xmlhttpRequest({ url: url, method: "POST", data: `{"title":"服务脚本","url":"","content":"${content}"}`, responseType: "json", headers: { 'Content-Type': 'application/json', }, async onload(xhr) { console.log(xhr) console.log(xhr.response) } }); } function postmsgwithtokem(url,content,token){ GM_xmlhttpRequest({ url: url, method: "POST", data: `{"token":"${token}","content":"${content}"}`, responseType: "json", headers: { 'Content-Type': 'application/json', }, async onload(xhr) { console.log(xhr) console.log(xhr.response) } }); }