From 8b890e86521d6bf856ec7f65a018be8f5a36261f Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 15 Jun 2015 18:56:48 +0300 Subject: [PATCH] Editor: don't save window size after browser restart Because if an edit style window was the only window open when closing the browser it'll become the main browser window after restart and is likely to be resized differently. --- edit.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/edit.js b/edit.js index c516828b..d681002c 100644 --- a/edit.js +++ b/edit.js @@ -409,8 +409,12 @@ chrome.tabs.query({currentWindow: true}, function(tabs) { var windowId = tabs[0].windowId; if (prefs.getPref("openEditInWindow")) { if (tabs.length == 1 && window.history.length == 1) { - sessionStorageHash("saveSizeOnClose").set(windowId, true); - saveSizeOnClose = true; + chrome.windows.getAll(function(windows) { + if (windows.length > 1) { + sessionStorageHash("saveSizeOnClose").set(windowId, true); + saveSizeOnClose = true; + } + }); } else { saveSizeOnClose = sessionStorageHash("saveSizeOnClose").value[windowId]; }