Simplify the PDFViewerApplication.supportsFullscreen
getter
A lot of the code in this getter has existed ever since the initial PresentationMode-implementation was first added all the way back in PR 1938 (which is nine years ago now). At this point in time however, there's now a simpler way detect if a browser supports the FullScreen API and we should thus be able to simplify this getter; please refer to https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled#browser_compatibility
This commit is contained in:
parent
8ff0f8e4df
commit
bc2bb18af7
20
web/app.js
20
web/app.js
@ -679,21 +679,13 @@ const PDFViewerApplication = {
|
|||||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||||
return shadow(this, "supportsFullscreen", document.fullscreenEnabled);
|
return shadow(this, "supportsFullscreen", document.fullscreenEnabled);
|
||||||
}
|
}
|
||||||
const doc = document.documentElement;
|
return shadow(
|
||||||
let support = !!(
|
this,
|
||||||
doc.requestFullscreen ||
|
"supportsFullscreen",
|
||||||
doc.mozRequestFullScreen ||
|
document.fullscreenEnabled ||
|
||||||
doc.webkitRequestFullScreen
|
document.mozFullScreenEnabled ||
|
||||||
|
document.webkitFullscreenEnabled
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
|
||||||
document.fullscreenEnabled === false ||
|
|
||||||
document.mozFullScreenEnabled === false ||
|
|
||||||
document.webkitFullscreenEnabled === false
|
|
||||||
) {
|
|
||||||
support = false;
|
|
||||||
}
|
|
||||||
return shadow(this, "supportsFullscreen", support);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get supportsIntegratedFind() {
|
get supportsIntegratedFind() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user