Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Uint8Array and ArrayBuffer to the list of types that can be sent in a GM_xmlhttpRequest request #2299

Open
rainsillwood opened this issue Dec 14, 2024 · 2 comments

Comments

@rainsillwood
Copy link

rainsillwood commented Dec 14, 2024

Browser:Chrome131.0.6778.140
Extension:5.3.3/5.3.2

I used GM_xmlhttpRequest to post a transformed msgpack data(as Uint8Array) to the sever,but it post as string '[object Object]'
图片

with Firefox all well done
图片
图片

my repository :https://github.com/rainsillwood/MementoMoriGuildHelper
request code on line 944,responseType is arraybuffer,Content-Type in headers is 'application/json; charset=UTF-8'
图片

@derjanb
Copy link
Member

derjanb commented Dec 14, 2024

Sending Uint8Arrays is not offically supported.

Workaround: use a Blob.

    data: new Blob([ new Uint8Array(binary_data) ]),

Adding Uint8Array and ArrayBuffer to list might make sense though.

@derjanb derjanb added this to the 5.4 milestone Dec 14, 2024
@derjanb derjanb changed the title Using GM_xmlhttpRequest with chrome send unexpected data Add Uint8Array and ArrayBuffer to the list of types that can be sent in a GM_xmlhttpRequest request Dec 14, 2024
@derjanb
Copy link
Member

derjanb commented Jan 19, 2025

Should be fixed at 5.4.6224

Please install Tampermonkey BETA or force update it at the extensions page chrome://extensions.

For a quick fix please export your settings and scripts as zip or (JSON) file at the "Utilities" tab and import it back at the fixed BETA version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants