mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
client-side override fix: first set window.devicePixelRatio to 1, also prevent from changing, if possible (catch exception)
This commit is contained in:
parent
ce3ba9e42e
commit
9fdff8388e
@ -721,9 +721,15 @@ var _WBWombat = function($wbwindow, wbinfo) {
|
|||||||
|
|
||||||
//============================================
|
//============================================
|
||||||
function init_fixed_ratio() {
|
function init_fixed_ratio() {
|
||||||
|
// otherwise, just set it
|
||||||
|
$wbwindow.devicePixelRatio = 1;
|
||||||
|
|
||||||
|
// prevent changing, if possible
|
||||||
if (Object.defineProperty) {
|
if (Object.defineProperty) {
|
||||||
// fixed pix ratio
|
try {
|
||||||
Object.defineProperty($wbwindow, "devicePixelRatio", {value: 1, configurable: false});
|
// fixed pix ratio
|
||||||
|
Object.defineProperty($wbwindow, "devicePixelRatio", {value: 1, writable: false});
|
||||||
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user