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

[Firemonkey] xmlhttpRequest Headers Compatibility #569

Closed
HoodB0 opened this issue Jul 3, 2023 · 1 comment
Closed

[Firemonkey] xmlhttpRequest Headers Compatibility #569

HoodB0 opened this issue Jul 3, 2023 · 1 comment

Comments

@HoodB0
Copy link

HoodB0 commented Jul 3, 2023

Setting "headers" to null while making a request leads to an error with no trace.

GM_xmlhttpRequest({
  url: "https://example.org",
  method: "GET",
  headers: null, // Error: An unexpected apiScript error occurred
  onload: function(response) {
    console.log(response)
  }
})

This doesn't happen in ViolentMonkey (didn't test with TamperMonkey), and yes, scripts do set headers to null (4chan-X).

@erosman
Copy link
Owner

erosman commented Jul 3, 2023

GM|TM|VM also expect xmlHttpRequest headers to be an object.

Although null is also an object, it will cause an error with Object.keys(null) in FireMonkey.

I will add a check to prevent error when it is set to null.

Fixed for v2.72

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