Closed clarentbloodarthur closed 1 year ago
Check can you reach https://elementdavv.github.io/ And by pressing F12 open developer page, from "Console" tab copy error details messages.
Can reach that URL: see an index with "welcome".
"It has been provided to "https://elementdavv.github.io/streamsaver.js/mitm.html?version=2.0.0" a partitioned cookie or access to storage resources because it is loaded in a third-party context and dynamic state partitioning is active."
chunk 12 ready content1.js:455:17 chunk 18 content1.js:366:17 chunk 13 ready content1.js:455:17 chunk 19 content1.js:366:17 File not created content1.js:254:21 failed content1.js:603:17 notify browser: abort content1.js:430:21 AbortError: The operation was aborted. 6 content1.js:399:21
Impossible to load “”. A ServiceWorker intercepted a request and encountered an unexpected error.
/ global self ReadableStream Response /
self.addEventListener('install', () => { self.skipWaiting() })
self.addEventListener('activate', event => { event.waitUntil(self.clients.claim()) })
const map = new Map()
// This should be called once per download // Each event has a dataChannel that the data will be piped through self.onmessage = event => { // We send a heartbeat every x second to keep the // service worker alive if a transferable stream is not sent if (event.data === 'ping') { return }
const data = event.data const downloadUrl = data.url || self.registration.scope + Math.random() + '/' + (typeof data === 'string' ? data : data.filename) const port = event.ports[0] const metadata = new Array(3) // [stream, data, port]
metadata[1] = data metadata[2] = port
// Note to self:
// old streamsaver v1.2.0 might still use readableStream
...
// but v2.0.0 will always transfer the stream through MessageChannel #94
if (event.data.readableStream) {
metadata[0] = event.data.readableStream
} else if (event.data.transferringReadable) {
port.onmessage = evt => {
port.onmessage = null
metadata[0] = evt.data.readableStream
}
} else {
metadata[0] = createStream(port)
}
map.set(downloadUrl, metadata) port.postMessage({ download: downloadUrl }) }
function createStream (port) { // ReadableStream is only supported by chrome 52 return new ReadableStream({ start (controller) { // When we receive data on the messageChannel, we write port.onmessage = ({ data }) => { if (data === 'end') { return controller.close() }
if (data === 'abort') {
controller.error('Aborted the download')
return
}
controller.enqueue(data)
}
},
cancel (reason) {
console.log('user aborted', reason)
port.postMessage({ abort: true })
}
}) }
self.onfetch = event => { const url = event.request.url
// this only works for Firefox if (url.endsWith('/ping')) { return event.respondWith(new Response('pong')) }
const hijacke = map.get(url)
if (!hijacke) return null
const [ stream, data, port ] = hijacke
map.delete(url)
// Not comfortable letting any user control all headers // so we only copy over the length & disposition const responseHeaders = new Headers({ 'Content-Type': 'application/octet-stream; charset=utf-8',
// To be on the safe side, The link can be opened in a iframe.
// but octet-stream should stop it.
'Content-Security-Policy': "default-src 'none'",
'X-Content-Security-Policy': "default-src 'none'",
'X-WebKit-CSP': "default-src 'none'",
'X-XSS-Protection': '1; mode=block',
'Cross-Origin-Embedder-Policy': 'require-corp'
})
let headers = new Headers(data.headers || {})
if (headers.has('Content-Length')) { responseHeaders.set('Content-Length', headers.get('Content-Length')) }
if (headers.has('Content-Disposition')) { responseHeaders.set('Content-Disposition', headers.get('Content-Disposition')) }
// data, data.filename and size should not be used anymore if (data.size) { console.warn('Depricated') responseHeaders.set('Content-Length', data.size) }
let fileName = typeof data === 'string' ? data : data.filename if (fileName) { console.warn('Depricated') // Make filename RFC5987 compatible fileName = encodeURIComponent(fileName).replace(/['()]/g, escape).replace(/*/g, '%2A') responseHeaders.set('Content-Disposition', "attachment; filename*=UTF-8''" + fileName) }
event.respondWith(new Response(stream, { headers: responseHeaders }))
port.postMessage({ debug: 'Download started' }) }
Again, everything worked correctly almost a week ago, never touched anything in about:config (and I was on this version of Firefox, too, I don't think the Web Browser is responsible for this odd behaviour).
Temporarily disable all other extensions, disable any security softwares such as firewall or antivirus applications. and try again.
Temporarily disable all other extensions, disable any security softwares such as firewall or antivirus applications. and try again.
Error still occurring.
Remove the extension, download the .xpi file version 0.5.1 and 0.6.0 from https://github.com/elementdavv/internet_archive_downloader/releases and test it again. You can drop the .xpi file to about:addons page to install it.
I'm happy to report that both of those older releases work. Download of borrowed books started and completed successfully, with firewall, antivirus and web browser's default security settings enabled. I guess there's some issue with version 0.6.1.
The extension passed test on Firefox 116.0.2 under Windows 11 pro. I have no windows 10 home version to debug. Can you record some screen. For version 0.6.0, from clicking download button, for 10 seconds. For version 0.6.1, from clicking download button, until error heppened.
I don't have the software required to record what happens on the screen, the best I can offer is a precise text version of the actions I take and what occurs (plus, I'm Italian and what I believe is the most important error message is written in Italian, so, I'll offer an accurate translation of it, my English is good enough for that, don't worry). I'll use the following book as example - https://archive.org/details/littlebigplanet20000unse
0.6.0
0.6.1
_Opening file littlebigplanet20000unse.pdf Temporary files download location\randomlygeneratednamefile.pdf.part (in this instance, it was "7EjpiHj.pdf.part", but again, another attempt would give a different name)) could not be saved, because it's not possible to read/access the source file.
Try again later or contact the system's administrator
For what it's worth, my user account is the only one on this PC and it has administrator privileges.
I've made a screenshot which shows the errors - https://www.turboimagehost.com/p/92347891/Screenshot_397.png.html
Uncheck "Always ask you where to save files"
Uncheck "Always ask you where to save files"
Already tried that, error still shows up.
In the screenshot you gived out, the error was caused by file saveas dialog. If you confirm it as soon as it show up, then the error will not occured. Or you can just set default download directory so that the dialog will not show up and the download will run well. If not, what is your new error?
In the screenshot you gived out, the error was caused by file saveas dialog. If you confirm it as soon as it show up, then the error will not occured. Or you can just set default download directory so that the dialog will not show up and the download will run well. If not, what is your new error?
Even if I attempt to confirm the save dialog, the error still shows up. There's no new error, the add-on still tells me that it couldn't create the temporary pdf.part file, because it couldn't access the source file also when the download location is automatically set. The way it is worded in Italian, the error implies the add-on fails to create the temporary file because it can't access the file stored on elementdavv.github.io (that's where the save file dialog states the pdf file is from, at least).
Writing to say that the latest version has seemingly fixed the issue. Borrowed books can be downloaded again.
My OS: Windows 10 Home Edition (version - 22H2) My Web Browser: Mozilla Firefox 116.0.2 (64 bit)
I granted the add-on the needed permissions in its settings tab, I borrow a book, but after clicking the Download button, regardless of quality picked, I get an error message which states: "randomlygeneratedname.pdf could not be saved, because it was not possible to read/access the source file." (the name of the .pdf file changes at every attempt).
Developer asked me to provide a link to the book I'm attempting to download;
https://archive.org/details/sim_saturday-review-uk_the-saturday-review_1926-01-02_141_3662
Frankly speaking, though, the error shows up on every book which can only be borrowed (even ones I've been able to download before).