Bug 870105 - Follow-up: Size the browser according to the user's screen size. r=ttaubert

This commit is contained in:
Drew Willcoxon 2013-06-04 17:25:50 -07:00
parent 6c9255e881
commit 1af90e337e

View File

@ -130,9 +130,17 @@ const BackgroundPageThumbs = {
browser.setAttribute("remote", "true");
browser.setAttribute("privatebrowsing", "true");
let [width, height] = PageThumbs._getThumbnailSize();
browser.style.width = width + "px";
browser.style.height = height + "px";
// Size the browser. Setting the width and height attributes doesn't
// work -- the resulting thumbnails are blank and transparent -- but
// setting the style does.
let width = {};
let height = {};
Cc["@mozilla.org/gfx/screenmanager;1"].
getService(Ci.nsIScreenManager).
primaryScreen.
GetRectDisplayPix({}, {}, width, height);
browser.style.width = width.value + "px";
browser.style.height = height.value + "px";
this._parentWin.document.documentElement.appendChild(browser);