Created
July 17, 2012 23:53
-
-
Save darktrojan/3133007 to your computer and use it in GitHub Desktop.
zoom to fit the viewport width from metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
let ww = gBrowser.selectedBrowser.boxObject.width; | |
let wu = gBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); | |
let w = parseFloat(wu.getDocumentMetadata("viewport-width")); | |
//gBrowser.contentDocument.documentElement.style.width = w + 'px'; | |
if (!isNaN(w)) | |
ZoomManager.zoom = ww/w; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment