2013-06-03 11:02:46 +04:00
|
|
|
function scaleRatio(scale) {
|
2018-10-16 02:53:43 +03:00
|
|
|
return {
|
|
|
|
"set": [
|
|
|
|
[ "layout.css.devPixelsPerPx", "" + scale ],
|
|
|
|
[ "apz.allow_zooming", true ],
|
|
|
|
[ "dom.meta-viewport.enabled", true ],
|
|
|
|
]
|
|
|
|
};
|
2013-06-03 11:02:46 +04:00
|
|
|
}
|
2018-10-16 02:53:43 +03:00
|
|
|
|
|
|
|
function getViewportInfo(aDisplayWidth, aDisplayHeight) {
|
|
|
|
let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {},
|
|
|
|
width = {}, height = {}, autoSize = {};
|
|
|
|
|
|
|
|
let cwu = SpecialPowers.getDOMWindowUtils(window);
|
|
|
|
cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom,
|
|
|
|
minZoom, maxZoom, width, height, autoSize);
|
|
|
|
return {
|
|
|
|
defaultZoom: defaultZoom.value,
|
|
|
|
minZoom: minZoom.value,
|
|
|
|
maxZoom: maxZoom.value,
|
|
|
|
width: width.value,
|
|
|
|
height: height.value,
|
|
|
|
autoSize: autoSize.value,
|
|
|
|
allowZoom: allowZoom.value
|
|
|
|
};
|
|
|
|
}
|