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

Change XMLHttpRequest to asynchronous #4

Open
Pheil opened this issue Mar 21, 2017 · 4 comments
Open

Change XMLHttpRequest to asynchronous #4

Pheil opened this issue Mar 21, 2017 · 4 comments

Comments

@Pheil
Copy link
Contributor

Pheil commented Mar 21, 2017

Placeholder for this issue. Both Chrome and Firefox throw an error for the current method being deprecated. I have code that is asynchronous, but it's not working perfectly due to other major changes made to support blob replacement. (Which could/should? be a separate issue)

@d-Pixie
Copy link
Member

d-Pixie commented Mar 23, 2017

Yes, I had some problem with this in the original design. If I remember correctly some part of this flow is forced to be synchronous by Chrome, ie. we can't return a promise, I think it was the request intercept. Makes sense since the request could otherwise hang indefinitely waiting for some before filter to resolve.
That forced me to use a synchronous load of the remote payload. If there is a new way of solving this I'm all ears. At the time there was not...

@Pheil
Copy link
Contributor Author

Pheil commented Mar 23, 2017

Here is my tweaked/condensed background.js if it generates any ideas for you. This probably could be fixed to replace the image with the data:image instead of the blob, but I wasn't expecting to run into the two bugs as I was tweaking it.
background.txt

@d-Pixie
Copy link
Member

d-Pixie commented Apr 1, 2017

I'll have a look at it when I have some time. What bugs did you encounter?

@Pheil
Copy link
Contributor Author

Pheil commented Apr 1, 2017

I put comments in the code for these two. Basically I changed it to asynchronous then was trying to use a blob instead of the data:url since the blob links open so much faster,

https://bugs.chromium.org/p/chromium/issues/detail?id=446453
//Cannot redirect to blob in Chrome or FF
https://bugzilla.mozilla.org/show_bug.cgi?id=1256122
//Due to this bug, redirect to blank tab and open blob in new tab.

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