mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Remove code-paths only relevant for IE 11/Edge (non-Chromium based) from the web/
folder
This patch purposely starts small, by removing IE-specific code from various JS/CSS files in the `web/` folder. There's obviously lots of potential for additional clean-up, especially the removal of no longer necessary polyfills in `src/shared/compatibility.js`, however that will require some care considering that certain polyfills may also be necessary for e.g. Node.js or the Chromium-extension as well. Generally speaking, once we start removing polyfills it's probably a good idea to consult the compatibility information on https://developer.mozilla.org/ and also https://caniuse.com/ first. (Deciding on the lowest supported Chromium version, for the extension, would also seem like a good idea.)
This commit is contained in:
parent
4caa14b4dc
commit
87b002c52f
9 changed files with 9 additions and 47 deletions
|
@ -35,7 +35,7 @@ function download(blobUrl, filename) {
|
|||
if ("download" in a) {
|
||||
a.download = filename;
|
||||
}
|
||||
// <a> must be in the document for IE and recent Firefox versions,
|
||||
// <a> must be in the document for recent Firefox versions,
|
||||
// otherwise .click() is ignored.
|
||||
(document.body || document.documentElement).appendChild(a);
|
||||
a.click();
|
||||
|
@ -51,11 +51,6 @@ class DownloadManager {
|
|||
}
|
||||
|
||||
downloadData(data, filename, contentType) {
|
||||
if (navigator.msSaveBlob) {
|
||||
// IE10 and above
|
||||
navigator.msSaveBlob(new Blob([data], { type: contentType }), filename);
|
||||
return;
|
||||
}
|
||||
const blobUrl = createObjectURL(
|
||||
data,
|
||||
contentType,
|
||||
|
@ -71,14 +66,6 @@ class DownloadManager {
|
|||
* the "open with" dialog.
|
||||
*/
|
||||
download(blob, url, filename, sourceEventType = "download") {
|
||||
if (navigator.msSaveBlob) {
|
||||
// IE10 / IE11
|
||||
if (!navigator.msSaveBlob(blob, filename)) {
|
||||
this.downloadUrl(url, filename);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (viewerCompatibilityParams.disableCreateObjectURL) {
|
||||
// URL.createObjectURL is not supported
|
||||
this.downloadUrl(url, filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue