1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

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:
Jonas Jenwald 2021-08-27 17:45:34 +02:00
parent 8ff0f8e4df
commit bc2bb18af7

View file

@ -679,21 +679,13 @@ const PDFViewerApplication = {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
return shadow(this, "supportsFullscreen", document.fullscreenEnabled);
}
const doc = document.documentElement;
let support = !!(
doc.requestFullscreen ||
doc.mozRequestFullScreen ||
doc.webkitRequestFullScreen
return shadow(
this,
"supportsFullscreen",
document.fullscreenEnabled ||
document.mozFullScreenEnabled ||
document.webkitFullscreenEnabled
);
if (
document.fullscreenEnabled === false ||
document.mozFullScreenEnabled === false ||
document.webkitFullscreenEnabled === false
) {
support = false;
}
return shadow(this, "supportsFullscreen", support);
},
get supportsIntegratedFind() {