diff --git a/edit.js b/edit.js index 7aefa068..99c756dc 100644 --- a/edit.js +++ b/edit.js @@ -69,6 +69,12 @@ function makeDirty() { } window.onbeforeunload = function() { + prefs.setPref('windowPosition', { + left: screenLeft, + top: screenTop, + width: outerWidth, + height: outerHeight + }); return dirty || isCodeDirty() ? t('styleChangesNotSaved') : null; } diff --git a/popup.js b/popup.js index 136f3588..97801709 100644 --- a/popup.js +++ b/popup.js @@ -144,7 +144,10 @@ function getId(event) { function openLinkInTabOrWindow(event) { event.preventDefault(); if (prefs.getPref('openEditInWindow', false)) { - chrome.windows.create({url: event.target.href}); + var options = {url: event.target.href} + var wp = prefs.getPref('windowPosition', {}); + for (var k in wp) options[k] = wp[k]; + chrome.windows.create(options); } else { openLink(event); }