Created
September 5, 2016 15:52
-
-
Save meandavejustice/77d2019bd0fb71d25fde5eb38573b9e6 to your computer and use it in GitHub Desktop.
Get browser document dimensions from Firefox SDK Panel (thanks @6a68)
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
const { getMostRecentBrowserWindow, getXULWindow } = require('sdk/window/utils'); | |
module.exports = getDocumentDimensions; | |
function getDocumentDimensions() { | |
let chromeWindow = getMostRecentBrowserWindow(); | |
if (!chromeWindow.document) { | |
chromeWindow = getXULWindow(chromeWindow); | |
} | |
return chromeWindow.document.documentElement.getBoundingClientRect(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment