Skip to content

Remove code-paths only relevant for IE 11/Edge (non-Chromium based) from the web/ folder #12328

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

Merged
merged 1 commit into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,13 @@ const PDFViewerApplication = {
support = !!(
doc.requestFullscreen ||
doc.mozRequestFullScreen ||
doc.webkitRequestFullScreen ||
doc.msRequestFullscreen
doc.webkitRequestFullScreen
);

if (
document.fullscreenEnabled === false ||
document.mozFullScreenEnabled === false ||
document.webkitFullscreenEnabled === false ||
document.msFullscreenEnabled === false
document.webkitFullscreenEnabled === false
) {
support = false;
}
Expand Down
15 changes: 1 addition & 14 deletions web/download_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion web/grab_to_pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ GrabToPan.prototype = {

// Get the correct (vendor-prefixed) name of the matches method.
let matchesSelector;
["webkitM", "mozM", "msM", "oM", "m"].some(function (prefix) {
["webkitM", "mozM", "oM", "m"].some(function (prefix) {
let name = prefix + "atches";
if (name in document.documentElement) {
matchesSelector = name;
Expand Down
10 changes: 1 addition & 9 deletions web/pdf_presentation_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ class PDFPresentationMode {
this.container.mozRequestFullScreen();
} else if (this.container.webkitRequestFullscreen) {
this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (this.container.msRequestFullscreen) {
this.container.msRequestFullscreen();
} else {
return false;
}
Expand Down Expand Up @@ -151,8 +149,7 @@ class PDFPresentationMode {
return !!(
document.fullscreenElement ||
document.mozFullScreen ||
document.webkitIsFullScreen ||
document.msFullscreenElement
document.webkitIsFullScreen
);
}

Expand Down Expand Up @@ -478,7 +475,6 @@ class PDFPresentationMode {
"webkitfullscreenchange",
this.fullscreenChangeBind
);
window.addEventListener("MSFullscreenChange", this.fullscreenChangeBind);
}
}

Expand All @@ -496,10 +492,6 @@ class PDFPresentationMode {
"webkitfullscreenchange",
this.fullscreenChangeBind
);
window.removeEventListener(
"MSFullscreenChange",
this.fullscreenChangeBind
);
}

delete this.fullscreenChangeBind;
Expand Down
2 changes: 1 addition & 1 deletion web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ window.addEventListener(

if ("onbeforeprint" in window) {
// Do not propagate before/afterprint events when they are not triggered
// from within this polyfill. (FF /IE / Chrome 63+).
// from within this polyfill. (FF / Chrome 63+).
const stopPropagationIfNeeded = function (event) {
if (event.detail !== "custom" && event.stopImmediatePropagation) {
event.stopImmediatePropagation();
Expand Down
4 changes: 0 additions & 4 deletions web/pdf_viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@
margin-right: auto;
}

.pdfPresentationMode:-ms-fullscreen .pdfViewer .page {
margin-bottom: 100% !important;
}

.pdfPresentationMode:fullscreen .pdfViewer .page {
margin-bottom: 100%;
border: 0;
Expand Down
1 change: 0 additions & 1 deletion web/ui_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ function getOutputScale(ctx) {
const backingStoreRatio =
ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
ctx.oBackingStorePixelRatio ||
ctx.backingStorePixelRatio ||
1;
Expand Down
9 changes: 0 additions & 9 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,6 @@ select {
cursor: not-allowed;
}

#viewerContainer.pdfPresentationMode:-ms-fullscreen {
top: 0px !important;
overflow: hidden !important;
}

#viewerContainer.pdfPresentationMode:-ms-fullscreen::-ms-backdrop {
background-color: rgba(0, 0, 0, 1);
}

#viewerContainer.pdfPresentationMode:fullscreen {
top: 0px;
border-top: 2px solid rgba(0, 0, 0, 0);
Expand Down
7 changes: 3 additions & 4 deletions web/viewer_compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
(typeof navigator !== "undefined" && navigator.maxTouchPoints) || 1;

const isAndroid = /Android/.test(userAgent);
const isIE = /Trident/.test(userAgent);
const isIOS =
/\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||
(platform === "MacIntel" && maxTouchPoints > 1);
Expand All @@ -32,9 +31,9 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
// Checks if possible to use URL.createObjectURL()
// Support: IE, Chrome on iOS
(function checkOnBlobSupport() {
// Sometimes IE and Chrome on iOS losing the data created with
// createObjectURL(), see issues #3977 and #8081.
if (isIE || isIOSChrome) {
// Sometimes Chrome on iOS loses data created with createObjectURL(),
// see issue #8081.
if (isIOSChrome) {
compatibilityParams.disableCreateObjectURL = true;
}
})();
Expand Down