elementdavv / internet_archive_downloader

A chrome/firefox extension that download books from Internet Archive(archive.org) and HathiTrust Digital Library (hathitrust.org)
GNU Affero General Public License v3.0
627 stars 43 forks source link

TypeError: NetworkError when attempting to fetch resource. Please contact the developer. #9

Closed spinktvis closed 4 months ago

spinktvis commented 1 year ago

The following error always pops up whenever I click on download:

TypeError: NetworkError when attempting to fetch resource. Please contact the developer.

This is on Firefox 114.0.1, Arch Linux. I tried different books, borrow for one hour, borrow for fourteen days, but the same error appears. Let me know if you need any more information.

elementdavv commented 1 year ago

Press F12 to show developer page. Then from "Console" tab, show me the detail error messages.

spinktvis commented 1 year ago
`This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. enlightenedminda0000unse
Loading failed for the <script> with source “https://archive.org/includes/analytics.js?v=ef86f096”. enlightenedminda0000unse:40:88
The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information. <anon>:1175:67
Internet Archive Downloader v0.5.0 in action content1.js:424:13
load /js/stub.js content1.js:35:17
Some cookies are misusing the recommended “SameSite“ attribute 6
done <anon>:1175:67
message: iad init content1.js:21:17
init begin content1.js:138:17
load buttons content1.js:56:17
load /css/iad.css content1.js:43:17
load qualities content1.js:82:17
get book info content1.js:106:17
get metadata content1.js:115:17
init complete content1.js:143:17
message: iad begin content1.js:21:17
download enlightenedminda0000unse.pdf of quality 1 at Sun Jun 18 2023 19:08:49 GMT+0200 (Central European Summer Time) content1.js:191:21
chunks: 244 content1.js:212:17
chunk 1 content1.js:239:21
chunk 2 content1.js:239:21
chunk 3 content1.js:239:21
chunk 4 content1.js:239:21
chunk 5 content1.js:239:21
Cookie “” has been rejected as third-party. mitm.html
Cookie “” has been rejected as third-party. mitm.html
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
mitm.html
Request to access cookie or storage on “https://elementdavv.github.io/streamsaver.js/mitm.html?version=2.0.0” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.

Failed to get service worker registration(s): Storage access is restricted in this context due to user settings or private browsing mode. mitm.html:40:33
Uncaught (in promise) DOMException: The operation is insecure.
    registerWorker https://elementdavv.github.io/streamsaver.js/mitm.html?version=2.0.0:40
    <anonymous> https://elementdavv.github.io/streamsaver.js/mitm.html?version=2.0.0:156
mitm.html:40
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia601705.us.archive.org/BookReader/BookReaderImages.php?zip=/5/items/enlightenedminda0000unse/enlightenedminda0000unse_jp2.zip&file=enlightenedminda0000unse_jp2/enlightenedminda0000unse_0005.jp2&id=enlightenedminda0000unse&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:268:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia601705.us.archive.org/BookReader/BookReaderImages.php?zip=/5/items/enlightenedminda0000unse/enlightenedminda0000unse_jp2.zip&file=enlightenedminda0000unse_jp2/enlightenedminda0000unse_0004.jp2&id=enlightenedminda0000unse&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:268:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia601705.us.archive.org/BookReader/BookReaderImages.php?zip=/5/items/enlightenedminda0000unse/enlightenedminda0000unse_jp2.zip&file=enlightenedminda0000unse_jp2/enlightenedminda0000unse_0002.jp2&id=enlightenedminda0000unse&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:268:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia601705.us.archive.org/BookReader/BookReaderImages.php?zip=/5/items/enlightenedminda0000unse/enlightenedminda0000unse_jp2.zip&file=enlightenedminda0000unse_jp2/enlightenedminda0000unse_0003.jp2&id=enlightenedminda0000unse&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:268:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia601705.us.archive.org/BookReader/BookReaderImages.php?zip=/5/items/enlightenedminda0000unse/enlightenedminda0000unse_jp2.zip&file=enlightenedminda0000unse_jp2/enlightenedminda0000unse_0001.jp2&id=enlightenedminda0000unse&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource.`
elementdavv commented 1 year ago

As the messages said, the third-party cookies needed were rejected. Try enable it, or choose another content blocking policy which are not so strict.

May be add 'archive.org' to 'Manage Exception...' button from 'Setttings->Privacy->Enhanced Tracking Protection' will solve your problem.

spinktvis commented 1 year ago

I added archive.org to the exceptions in Firefox but the problem persisted with the same error.

Then I tried it with Chromium instead, this worked.

robatino commented 1 year ago

Was it necessary to do anything to make it work with Chromium, or did it just work out of the box? And could this ticket be reopened since it's still not solved with Firefox 113+, which is supposed to work? Thanks.

spinktvis commented 1 year ago

It worked out of the box on Chromium. I'd suggest opening a new ticket for your issue.

robatino commented 1 year ago

I could open a new ticket, but it would just be an exact duplicate of your issue. Switching browsers wasn't a fix for the original issue (not working on Firefox). I know that Chromium by default doesn't block third-party cookies (which may be why it works out of the box on that), but Firefox does. And it's expected that Chromium will eventually block third-party cookies by default as well.

elementdavv commented 1 year ago

I could open a new ticket, but it would just be an exact duplicate of your issue. Switching browsers wasn't a fix for the original issue (not working on Firefox). I know that Chromium by default doesn't block third-party cookies (which may be why it works out of the box on that), but Firefox does. And it's expected that Chromium will eventually block third-party cookies by default as well.

Try add '*.github.io' to third party cookie exception. It may be more customized for Arch.

robatino commented 1 year ago

I tried putting exceptions for archive.org and github.io in "Exceptions - Cookies and Site Data" under Settings/Privacy & Security, no luck. Then I tried enabling all cookies by choosing "Custom" under "Enhanced Tracking Protection", unchecked "Cookies", then "Reload All Tabs", that didn't work either. Firefox doesn't make it easy to disable protection so I may not be doing it right. Sorry for my ignorance. (BTW, I'm using Fedora Linux, Firefox 115.0.2.)

elementdavv commented 1 year ago

I tried putting exceptions for archive.org and github.io in "Exceptions - Cookies and Site Data" under Settings/Privacy & Security, no luck. Then I tried enabling all cookies by choosing "Custom" under "Enhanced Tracking Protection", unchecked "Cookies", then "Reload All Tabs", that didn't work either. Firefox doesn't make it easy to disable protection so I may not be doing it right. Sorry for my ignorance. (BTW, I'm using Fedora Linux, Firefox 115.0.2.)

I have just download fedora38, install it as virtual machine, boot up, remove the default firefox 111, download firefox 115.0.2, unpacked, run, install the extension, download a book, and it success! It worked out of the box completely. I do not change any settings. May be you can remove firefox(include profiles) and reinstall it.

robatino commented 1 year ago

Hmm. I temporarily moved aside my ~/.mozilla dir and started it with a blank profile. I had NoScript installed globally and it still had that enabled by default, so I globally disabled it in Firefox and restarted. Then when attempting to download an ebook, I still got the same NetworkError, but I DID see a cancelled download with a link like https://elementdavv.github.io/streamsaver.js/archive.org/255116/XXXXXXXXXXX.pdf, which I didn't see before. So some progress, anyway. Any chance it could somehow be network-related instead of the browser?

Edit: Am successfully running it in Chromium out of the box, using the same machine, OS, and network, which seems to disprove the network theory. BTW, I'm using Firefox 115.0.2 from the Fedora repo, not the generic one from Mozilla.org. Same for Chromium. Don't know if that matters.

Edit: I had 3 extensions installed globally from Fedora packages: mozilla-ublock-origin, mozilla-noscript, and mozilla-https-everywhere. I temporarily removed those 3 packages and repeated the above experiment with the clean Firefox profile. Same exact result. AFAIK the only thing I'm doing differently is using Firefox from the Fedora repo instead of Mozilla.org.

Edit: Tried installing and running a copy from the Mozilla.org tarball with a clean profile. Same behavior as before (NetworkError and a cancelled download).

elementdavv commented 1 year ago

Edit: Tried installing and running a copy from the Mozilla.org tarball with a clean profile. Same behavior as before (NetworkError and a cancelled download).

Provide your NetworkError complete details.

robatino commented 1 year ago

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. 200metersdown00clin The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information. :1175:67 donation-banner loaded Object { version: "1.1.1" }

:1175:67 SoundManager 2: No Flash detected. Trying HTML5-only mode. :1175:67 SoundManager V2.97a.20170601 (HTML5-only mode) :1175:67 SoundManager 2 HTML5 support: mp3 = true, mp4 = true, ogg = true, opus = true, wav = true, flac = true :1175:67 SoundManager 2: Ready. ✓ :1175:67 Internet Archive Downloader v0.5.0 in action content1.js:424:13 load /js/stub.js content1.js:35:17 done :1175:67 message: iad init content1.js:21:17 init begin content1.js:138:17 load buttons content1.js:56:17 load /css/iad.css content1.js:43:17 load qualities content1.js:82:17 get book info content1.js:106:17 get metadata content1.js:115:17 init complete content1.js:143:17 Some cookies are misusing the recommended “SameSite“ attribute 8 message: iad begin content1.js:21:17 download 200metersdown00clin.pdf of quality 1 at Wed Jul 26 2023 10:33:54 GMT-0400 (Eastern Daylight Time) content1.js:191:21 chunks: 196 content1.js:212:17 chunk 1 content1.js:239:21 chunk 2 content1.js:239:21 chunk 3 content1.js:239:21 chunk 4 content1.js:239:21 chunk 5 content1.js:239:21 This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “”. mitm.html Partitioned cookie or storage access was provided to “https://elementdavv.github.io/streamsaver.js/mitm.html?version=2.0.0” because it is loaded in the third-party context and dynamic state partitioning is enabled. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0004.jp2&id=200metersdown00clin&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. TypeError: NetworkError when attempting to fetch resource. content1.js:268:21 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0002.jp2&id=200metersdown00clin&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. TypeError: NetworkError when attempting to fetch resource. content1.js:268:21 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0005.jp2&id=200metersdown00clin&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. TypeError: NetworkError when attempting to fetch resource. content1.js:268:21 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0003.jp2&id=200metersdown00clin&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. TypeError: NetworkError when attempting to fetch resource. content1.js:268:21 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0001.jp2&id=200metersdown00clin&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. TypeError: NetworkError when attempting to fetch resource. content1.js:268:21 Failed to load ‘’. A ServiceWorker intercepted the request and encountered an unexpected error. sw.js:127:8 message: undefined undefined content1.js:21:17
robatino commented 1 year ago

The above output is from using the Mozilla.org tarball with a clean profile. I get similar output with my regular version of Firefox, including the reference to "Internet Archive Downloader v0.5.0", even though about:addons shows that I have 0.5.1 installed.

elementdavv commented 1 year ago

Your problem is cors, not cookie.

From 'about:addons', disable and enable the extension. From 'about:debugging', find the extension. With the status of the extension is 'running', click its 'inspect' button. From the popup window, choose console tab, input 'chrome.declarativeNetRequest', show the output. It is null or not?

robatino commented 1 year ago

If I followed your instructions correctly, the output is Object { updateDynamicRules: Getter & Setter, getEnabledRulesets: Getter & Setter, updateEnabledRulesets: Getter & Setter, getAvailableStaticRuleCount: Getter & Setter, getDynamicRules: Getter & Setter, getSessionRules: Getter & Setter, isRegexSupported: Getter & Setter, testMatchOutcome: Getter & Setter, DYNAMIC_RULESET_ID: Getter & Setter, GUARANTEED_MINIMUM_STATIC_RULES: Getter & Setter, … } in both the tarball Firefox and the Firefox from the Fedora repo (in both cases starting with a clean profile and no other extensions).

elementdavv commented 1 year ago

So the function existed but it didn't work in your context.

whatfuturedotlol commented 1 year ago

i'm having the exact same error as robatino, with the exact same output on debugging.

Object { updateDynamicRules: Getter & Setter, getEnabledRulesets: Getter & Setter, updateEnabledRulesets: Getter & Setter, getAvailableStaticRuleCount: Getter & Setter, getDynamicRules: Getter & Setter, getSessionRules: Getter & Setter, isRegexSupported: Getter & Setter, testMatchOutcome: Getter & Setter, DYNAMIC_RULESET_ID: Getter & Setter, GUARANTEED_MINIMUM_STATIC_RULES: Getter & Setter, … }

elementdavv commented 1 year ago

i'm having the exact same error as robatino, with the exact same output on debugging.

Firefox worked well in a fresh fedora. So you could try remove firefox completely and reinstall it. Or try install a new OS and firefox with your personal behavior to see if it works or not. On different linux box, applications may interfere with each other that is hard to debug.

robatino commented 1 year ago

For me, a new Firefox (the Mozilla.org tarball version) in an existing Fedora 38 Workstation which was clean installed a few months ago did not work. I could try running Fedora 38 Workstation live and updating Firefox to a recent version to test, will report back if I have the chance to do that.

whatfuturedotlol commented 1 year ago

so i got it working in edge (i'm on a mac m1 btw). firefox immediately failed, and chrome failed between 0% and 99% with the same error message.

robatino commented 1 year ago

I booted the Fedora 38 Workstation Live, updated Firefox from the repository to 116.0 (the Live comes with 111.0.1), then tried both that and the 116.0 tarball from Mozilla.org. In both cases, the download started (using 2 star quality), but about 2/3 of the way through, failed with the same NetworkError as before, with the CORS error messages in the F12 developer page. (In my previous attempts the failure was immediate, I saw no download at all.) My download speed is only 3 Mbit/s so maybe it would have finished successfully with a faster connection?

elementdavv commented 1 year ago

so i got it working in edge (i'm on a mac m1 btw). firefox immediately failed, and chrome failed between 0% and 99% with the same error message.

If it failed immediately, it may actually not work. If it failed only at some point, it works.

elementdavv commented 1 year ago

I booted the Fedora 38 Workstation Live, updated Firefox from the repository to 116.0 (the Live comes with 111.0.1), then tried both that and the 116.0 tarball from Mozilla.org. In both cases, the download started (using 2 star quality), but about 2/3 of the way through, failed with the same NetworkError as before, with the CORS error messages in the F12 developer page. (In my previous attempts the failure was immediate, I saw no download at all.) My download speed is only 3 Mbit/s so maybe it would have finished successfully with a faster connection?

If it does not work, it will fail at every page. So. It works in your case.

robatino commented 1 year ago

I should add that not only did it not complete downloading the entire book, but the download file in ~/Downloads was empty, so none of it was actually saved. So far it only works for me using Chromium.

elementdavv commented 1 year ago

Try version 0.6.0. It has just been released.

robatino commented 1 year ago

It's definitely closer to working - I noticed that my regular browser was automatically updated to the 0.6.0, so I just tried the download, without restarting the browser, and the progress bar started (which I didn't see before in this browser), but after around 2/3, it failed again with the same error. Below is the last couple of lines from the F12 developer panel. (BTW, as usual, I did not see a cancelled download. I will try it with the Mozilla.org tarball to see if I see the download there, like I did before.)

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0190.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 189 failed, retry 2 content1.js:391:29 chunk 195 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0191.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 190 failed, retry 2 content1.js:391:29 chunk 193 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0189.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 188 failed, retry 2 content1.js:391:29 chunk 3 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0193.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 192 failed, retry 2 content1.js:391:29 chunk 4 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0195.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 194 failed, retry 2 content1.js:391:29 chunk 5 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0196.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 195 failed, retry 2 content1.js:391:29 chunk 1 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0192.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 191 failed, retry 2 content1.js:391:29 chunk 2 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0194.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 trunk 193 failed, retry 2 content1.js:391:29 chunk 0 content1.js:350:17 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia802601.us.archive.org/BookReader/BookReaderImages.php?zip=/23/items/200metersdown00clin/200metersdown00clin_jp2.zip&file=200metersdown00clin_jp2/200metersdown00clin_0004.jp2&id=200metersdown00clin&scale=4&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource. content1.js:383:21 failed content1.js:583:17 notify browser: abort content1.js:416:21 AbortError: The operation was aborted. 5 content1.js:383:21

robatino commented 1 year ago

I noticed that while the book was downloading, NoScript showed that JavaScript was blocked for elementdavv.github.io, so I set it to Trusted while it was downloading, and after that I do see a failed download link. So that particular issue was caused by NoScript.

Edit: Tested again with the Mozilla.org tarball for Firefox 116 with a clean profile, behaves exactly the same as with my regular Firefox with existing profile (now that I'm not blocking JavaScript for elementdavv.github.io in my regular Firefox).

elementdavv commented 1 year ago

From your error message, your Firefox does not work.

aryan-gupta commented 1 year ago

I am also getting this error. I just started using this app. These errors are printed to the console starting almost immediately after clicking the download button and about 75% of the way through, it gives me a pop up error.

I'm using extension version 0.6.1, Arch Linux 6.1.39-1-lts, Firefox 115.0.2 (64-bit).

I have not tried chrome, will be trying that next

Here is a console log:

message: begin content1.js:47:17
ready content1.js:611:17
message: begin content1.js:47:17
download vectoranalysis0000spie.pdf of scale 1 at 2023-08-15T22:28:55 content1.js:224:21
notify browser: new content1.js:266:25
chunk number: 236 content1.js:310:17
start content1.js:580:17
chunk 0 content1.js:366:17
chunk 1 content1.js:366:17
chunk 2 content1.js:366:17
chunk 3 content1.js:366:17
chunk 4 content1.js:366:17
chunk 5 content1.js:366:17
Object { cmd: "create" }
content1.js:183:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0006.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 5 failed, retry 1 content1.js:406:29
chunk 6 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0004.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 3 failed, retry 1 content1.js:406:29
chunk 7 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0002.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 1 failed, retry 1 content1.js:406:29
chunk 8 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0003.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 2 failed, retry 1 content1.js:406:29
chunk 9 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0010.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 9 failed, retry 1 content1.js:406:29
chunk 10 content1.js:366:17

... 100 LINES OMMITED ...

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0040.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 39 failed, retry 1 content1.js:406:29
chunk 45 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0042.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 41 failed, retry 1 content1.js:406:29
chunk 46 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0043.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 42 failed, retry 1 content1.js:406:29
chunk 47 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0044.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 43 failed, retry 1 content1.js:406:29
chunk 48 content1.js:366:17
Some cookies are misusing the recommended “SameSite“ attribute 12
Cookie “br-loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “ol-auth-url” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “br-loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “ol-auth-url” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “br-loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “ol-auth-url” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “br-loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “loan-vectoranalysis0000spie” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cookie “ol-auth-url” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite loan
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0045.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 44 failed, retry 1 content1.js:406:29
chunk 49 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0041.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 40 failed, retry 1 content1.js:406:29
chunk 50 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0046.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 45 failed, retry 1 content1.js:406:29
chunk 51 content1.js:366:17

... 1500 LINES OMMITED ...

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0233.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
trunk 232 failed, retry 2 content1.js:406:29
chunk 5 content1.js:366:17
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ia801400.us.archive.org/BookReader/BookReaderImages.php?zip=/6/items/vectoranalysis0000spie/vectoranalysis0000spie_jp2.zip&file=vectoranalysis0000spie_jp2/vectoranalysis0000spie_0010.jp2&id=vectoranalysis0000spie&scale=1&rotate=0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource. content1.js:399:21
failed content1.js:603:17
notify browser: abort content1.js:430:21
AbortError: The operation was aborted. 5 content1.js:399:21
Failed to load ‘’. A ServiceWorker intercepted the request and encountered an unexpected error. sw.js:127:8
elementdavv commented 1 year ago

I am also getting this error. I just started using this app. These errors are printed to the console starting almost immediately after clicking the download button and about 75% of the way through, it gives me a pop up error.

I'm using extension version 0.6.1, Arch Linux 6.1.39-1-lts, Firefox 115.0.2 (64-bit).

I have not tried chrome, will be trying that next

Here is a console log:

In developer page, change to "Network" tab, scroll to last items. Find any item which file column is "BookReadImages.php..." and click it. Then from right pane, find "cookies" tab. Copy all items or get a screen shot.

elementdavv commented 1 year ago

I have just created a new Arch Linux 6.4.10 qemu box, install firefox 116.0.2 by pacman. And again out of the box, without any settings changes, the extension works successfully.

API-Beast commented 1 year ago

This is how the headers of the native requests look like that get proper responses: image

This is how the headers of the requests look like this plugin sends and get rejected: image

Cookies are fine, most notable difference seems to be that you send a "cors"/"empty" request and the site itself sends a "no-cors"/"image" request.

elementdavv commented 1 year ago

This is how the headers of the native requests look like that get proper responses:

What are your error message?

API-Beast commented 1 year ago

A dialog box with "TypeError: NetworkError when attempting to fetch resource." after waiting like 5 minutes for the download to finish.

When you look at the network tab while the download is running you see that every single request is blocked cross origin requests and nothing was actually downloaded during this time. "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource".

elementdavv commented 1 year ago

A dialog box with "TypeError: NetworkError when attempting to fetch resource." after waiting like 5 minutes for the download to finish. When you look at the network tab while the download is running you see that every single request is blocked cross origin requests and nothing was actually downloaded during this time. "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource".

From the image you provided, it seems that you are on Firefox 117 with Windows 10. Right? To my knowledge it always work well in Windows. Try run "firefox -P" to start profie manager. Create a new profile and start Firefox with it. Install the extension and test it.

Why-not-now commented 1 year ago

I am also experiencing this issue on Firefox 118 on Windows 10.

elementdavv commented 1 year ago

I am also experiencing this issue on Firefox 118 on Windows 10.

  • I have tried creating a new profile
  • adding exceptions to enhanced tracker blocking

Press F12 to show developer page. Then from "Console" tab, get detailed error messages.

Terramoto commented 1 year ago

Hello,

I was having the same issue, Firefox rejecting requests to subdomain due to CORS policy. There's an extension to work around this issue which is called "CORS Everywhere" but i would suggest disabling after the download is complete.

elementdavv commented 1 year ago

Hello,

I was having the same issue, Firefox rejecting requests to subdomain due to CORS policy. There's an extension to work around this issue which is called "CORS Everywhere" but i would suggest disabling after the download is complete.

Yes. The extension had integrated the Cors function inside but it seems not work for some people due to unknown cause. In this situation you could try use a third party Cors extension.