Synchronous AJAX call fail in Firefox

Open Beginner friendly
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
frontend, web-dev

Research direction

Start at dist/xhook.js around lines 451, 468, 487, and 517, following the synchronous send path in Firefox. Check the documented XMLHttpRequest withCredentials restriction for synchronous requests. Done means synchronous AJAX calls no longer throw this exception while the existing asynchronous behavior remains intact.

Written by the indexing model from the issue text.

Description

It fails with

A parameter or an operation is not supported by the underlying object
window[XMLHTTP]/facade.send/send@http://localhost:3000/dist/xhook.js:468:11
window[XMLHTTP]/facade.send/process@http://localhost:3000/dist/xhook.js:487:1
window[XMLHTTP]/facade.send@http://localhost:3000/dist/xhook.js:517:5
...

It fails on https://github.com/jpillora/xhook/blob/gh-pages/dist/xhook.js#L451 when you try to set withCredentails property to XHR object.

This seems to be a documented behavior.

According to https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest

Note: Starting with Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8), Gecko no longer lets you use the withCredentials attribute when performing synchronous requests. Attempting to do so throws an NS_ERROR_DOM_INVALID_ACCESS_ERR exception.

Dominant language
HTML
Stars
1k
Forks
151
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jpillora/xhook

All issues in jpillora/xhook

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.