All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.Fullscreen.js Maven / Gradle / Ivy

There is a newer version: 3.9.2
Show newest version
//
// stubbing document to support fullscreen
//
document.originalGetElementById = document.getElementById;

document.fullscreenEnabled = true;

Object.defineProperty(document, 'fullscreenElement', {
  value: null,
  writable: true,
  configurable: true
});

document.exitFullscreen = function() {
    document.fullscreenElement = null;
};

document.getElementById = function(id) {
    const e = document.originalGetElementById(id);
    if (e) {
        e.requestFullscreen = function() {
            document.fullscreenElement = this;
        };
    }

    return e;
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy