在tampermonkey 和scriptcat里行为不一样; scriptcat里没有提交上去,好像只提交了一个`[object object]`字符串 ``` // ==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... })(); ```
Activity
CodFrm commentedon Jan 11, 2022
知道了,scriptcat还没有支持
blob的数据,data暂时只能支持string | FormData,这两天处理一下✨ GM_xmlhttpRequest支持blob数据 #29
CodFrm commentedon Jan 11, 2022
支持 71a039f
ChitaGideon commentedon Jan 12, 2022
这么快的吗,ArrayBuffer 要不要也顺便补上呢?
CodFrm commentedon Jan 12, 2022
也可以,直接内部转换成blob就行,不过我看tm他们好像是不支持ArrayBuffer的?
CodFrm commentedon Jan 12, 2022
虽然时间不多,但是一些兼容性的问题还是会尽快处理更新的
ChitaGideon commentedon Jan 12, 2022
好的, 那我就等下一个版本更新试试