tiff-viewer-extension icon indicating copy to clipboard operation
tiff-viewer-extension copied to clipboard

Change XMLHttpRequest to asynchronous

Open Pheil opened this issue 7 years ago • 4 comments

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)

Pheil avatar Mar 21 '17 17:03 Pheil

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...

d-Pixie avatar Mar 23 '17 09:03 d-Pixie

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

Pheil avatar Mar 23 '17 12:03 Pheil

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

d-Pixie avatar Apr 01 '17 09:04 d-Pixie

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.

Pheil avatar Apr 01 '17 12:04 Pheil