Skip to content

Commit

Permalink
fix: tampermonkey mv3
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 11, 2024
1 parent 6b937a8 commit fb055de
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/utils/gm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,9 @@ export const GM_fetch = async (
headers: headers2obj(sendHeaders),
data,
binary,
responseType: 'blob',
async onload(e) {
let body: BodyInit | null | undefined = undefined;
if (!(e.response instanceof Blob && e.response.size == 0)) {
// Response': Response with null body status cannot have body
body = e.response ?? e.responseText;
}
await delay();
const resp = new Response(body, {
const resp = new Response(e.response || e.responseText || null, {
status: e.status,
statusText: e.statusText,
headers: parseHeaders(e.responseHeaders),
Expand Down

0 comments on commit fb055de

Please sign in to comment.