Created
November 12, 2014 07:38
Revisions
-
Infocatcher created this gist
Nov 12, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ var textZoom = 1.5; var fullZoom = 1; var scrollX = 0; var scrollY = 200; var tab = gBrowser.addTab("https://addons.mozilla.org/"); var browser = tab.linkedBrowser; if(scrollX || scrollY) { var scrollTimer = setInterval(function() { var win = browser.contentWindow; win.scrollTo(scrollX, scrollY); if(win.scrollX == scrollX && win.scrollY == scrollY) { clearInterval(scrollTimer); scrollTimer = 0; browser.removeEventListener("load", onLoad, true); } }, 50); var onLoad = function(e) { browser.removeEventListener("load", onLoad, true); if(scrollTimer) { clearInterval(scrollTimer); scrollTimer = 0; } browser.contentWindow.scrollTo(scrollX, scrollY); }; browser.addEventListener("load", onLoad, true); } if(textZoom != 1 || fullZoom != 1) { // Note: correctly works only with browser.zoom.siteSpecific = false var viewer = browser.markupDocumentViewer; viewer.textZoom = textZoom; viewer.fullZoom = fullZoom; }