trim21 / gm-fetch

fetch API for `GM.xmlHttpRequest`
MIT License
23 stars 3 forks source link

GM_Fetch fails on Firefox #174

Closed Trellmor closed 1 month ago

Trellmor commented 1 month ago

Description

Error: Permission denied to access property "autoAllocateChunkSize"
    toReadableStream moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/userscripts/3CX-TAPI.user.js?id=008d8d0b-316b-4138-a7e7-bd2a17e90dda:4417
    ResImpl moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/userscripts/3CX-TAPI.user.js?id=008d8d0b-316b-4138-a7e7-bd2a17e90dda:4342
    parseGMResponse moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/userscripts/3CX-TAPI.user.js?id=008d8d0b-316b-4138-a7e7-bd2a17e90dda:4330
    onload moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/userscripts/3CX-TAPI.user.js?id=008d8d0b-316b-4138-a7e7-bd2a17e90dda:4445
    wt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:9
    onload moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:28
    wt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:9
    i moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:37
    wt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:9
    r moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:24
    ko moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:25
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    o moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:37
    forEach self-hosted:160
    yt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:8
    t moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:9
    o moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:37
    t moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:35
    (Async: setTimeout handler)
    setTimeout moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:51
    processMessage moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:54
    <anonymous> moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:81
    Eo moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:35
    Eo moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:35
    s moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:36
    forEach self-hosted:160
    yt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:8
    t moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:9
    s moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:36
    wrapFunction chrome://extensions/content/child/ext-userScripts-content.js:241
    send moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    Wn moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:17
    send moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    ko moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:25
    Ao moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:25
    i moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:37
    f moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:46
    AsyncFunctionNext self-hosted:807
    (Async: async)
    f moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:47
    q moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:45
    f moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:45
    message moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:20
    forEach self-hosted:160
    wt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:9
    t moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:9
    message moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:20
    message moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:21
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:83
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    pagejs moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/page.js:75
    o moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:37
    forEach self-hosted:160
    yt moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:8
    t moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:9
    o moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:37
    send moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:35
    Mn moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:15
    send moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:35
    m moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:16
    g moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:16
    xhr moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:48
    s moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:45
    s moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:45
    AsyncFunctionNext self-hosted:807
    (Async: async)
    xhr moz-extension://8d5ae31e-df55-4193-bb5b-dd7c674b5e87/content.js:45
    apply self-hosted:2292
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.sys.mjs:675
    asyncWithoutClone resource://gre/modules/ExtensionCommon.sys.mjs:2835

Environment

How to reproduce

GM_fetch('https://some.site')

Expectations

Get the response

Actual result

Error: Permission denied to access property "autoAllocateChunkSize"

Notes

Probably related to https://bugzilla.mozilla.org/show_bug.cgi?id=1757836

trim21 commented 1 month ago

is there a workaround for us?

trim21 commented 1 month ago

maybe we need a ReadableStream polyfill

trim21 commented 1 month ago

I'm using firefox 131.0.2 and Tampermonkey 5.1.1 , I can't reproduce this.

Do you mind send a PR with ponyfill from https://github.com/Sec-ant/readable-stream?tab=readme-ov-file#ponyfill and confirm it's fixed?

trim21 commented 1 month ago

try 0.1.16 please

Trellmor commented 1 month ago

Thank you, yes, I can confirm that it works with 0.1.16.