|
|
@@ -81,6 +81,10 @@
|
|
|
scrollingElement.__defineGetter__("clientWidth", () => scrollWidth);
|
|
|
screen.__defineGetter__("height", () => scrollHeight);
|
|
|
screen.__defineGetter__("width", () => scrollWidth);
|
|
|
+ window._singleFile_innerHeight = window.innerHeight;
|
|
|
+ window._singleFile_innerWidth = window.innerWidth;
|
|
|
+ window.__defineGetter__("innerHeight", () => scrollHeight);
|
|
|
+ window.__defineGetter__("innerWidth", () => scrollWidth);
|
|
|
if (!keepZoomLevel) {
|
|
|
if (!window._singleFile_getBoundingClientRect) {
|
|
|
window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
|
@@ -94,10 +98,6 @@
|
|
|
}
|
|
|
return boundingRect;
|
|
|
};
|
|
|
- window._singleFile_innerHeight = window.innerHeight;
|
|
|
- window._singleFile_innerWidth = window.innerWidth;
|
|
|
- window.__defineGetter__("innerHeight", () => scrollHeight);
|
|
|
- window.__defineGetter__("innerWidth", () => scrollWidth);
|
|
|
}
|
|
|
}
|
|
|
if (!window._singleFileImage) {
|
|
|
@@ -209,11 +209,7 @@
|
|
|
if (!keepZoomLevel) {
|
|
|
if (window._singleFile_getBoundingClientRect) {
|
|
|
Element.prototype.getBoundingClientRect = window._singleFile_getBoundingClientRect;
|
|
|
- window.innerHeight = window._singleFile_innerHeight;
|
|
|
- window.innerWidth = window._singleFile_innerWidth;
|
|
|
delete window._singleFile_getBoundingClientRect;
|
|
|
- delete window._singleFile_innerHeight;
|
|
|
- delete window._singleFile_innerWidth;
|
|
|
}
|
|
|
}
|
|
|
if (window._singleFileImage) {
|
|
|
@@ -228,6 +224,10 @@
|
|
|
|
|
|
function resetScreenSize() {
|
|
|
const scrollingElement = document.scrollingElement || document.documentElement;
|
|
|
+ window.innerHeight = window._singleFile_innerHeight;
|
|
|
+ window.innerWidth = window._singleFile_innerWidth;
|
|
|
+ delete window._singleFile_innerHeight;
|
|
|
+ delete window._singleFile_innerWidth;
|
|
|
delete scrollingElement.clientHeight;
|
|
|
delete scrollingElement.clientWidth;
|
|
|
delete screen.height;
|