// ==UserScript==
// @name test Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http*://*/*
// @icon https://www.google.com/s2/favicons?domain=httpbin.org
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function () {
'use strict';
const url = 'http://httpbin.org/image/jpeg'
GM_xmlhttpRequest({
method: 'GET',
url: url,
responseType: "blob",
onload: function (req) {
console.log(req.status, req.response, typeof req.response)
GM_xmlhttpRequest({
method: 'PUT',
url: 'http://httpbin.org/anything',
data: req.response,
onload: function (req) {
console.log(req.status, req.response)
}
})
}
});
// Your code here...
})();
在tampermonkey 和scriptcat里行为不一样;
scriptcat里没有提交上去,好像只提交了一个
[object object]字符串