-
Notifications
You must be signed in to change notification settings - Fork 23
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
Error : Cannot Save Google Scholar Page #24
Comments
Using const a = document.createElement('a')
a.download = filename
a.href = URL.createObjectURL(blob)
a.click()
setTimeout(() => URL.revokeObjectURL(a.href), 5000) instead of SaveAsMHT/extension/background.js Lines 11 to 16 in 524c606
correctly saves the file. |
The alternative fix: function download(filename, blob) {
chrome.downloads.download({
conflictAction: 'prompt',
filename: filename,
saveAs: true,
url: URL.createObjectURL(blob),
}, downloadId => {
if (downloadId === undefined) {
const a = document.createElement('a')
a.download = filename
a.href = URL.createObjectURL(blob)
a.click()
setTimeout(() => URL.revokeObjectURL(a.href), 5000)
}
})
} Or function download(filename, blob) {
chrome.downloads.download({
conflictAction: 'prompt',
filename: filename,
saveAs: true,
url: URL.createObjectURL(blob),
}, downloadId => {
const lastError = chrome.runtime.lastError
if (lastError) {
console.log(lastError.message, filename)
const a = document.createElement('a')
a.download = filename
a.href = URL.createObjectURL(blob)
a.click()
setTimeout(() => URL.revokeObjectURL(a.href), 5000)
}
})
} |
There are some invisible characters in the site title
The result file name is
(with this feature #25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The extension works well, but I found one case failed.
When I clicked the button for saving a page from Google Scholar
(i.e. https://scholar.google.com/citations?user=vuJL4QwAAAAJ&hl=en),
there was no response and nothing happened.
I checked the background page of the extension. It shows the error : 'Unchecked runtime.lastError: Invalid filename'.
The text was updated successfully, but these errors were encountered: