usercss install: reuse current tab for editor when possible

This commit is contained in:
tophf 2017-11-29 00:05:52 +03:00
parent cbe90272b9
commit b762f48135

View File

@ -198,10 +198,13 @@
updateMeta(style); updateMeta(style);
sendMessage({method: 'openEditor', id: style.id}); if (!liveReload && !prefs.get('openEditInWindow')) {
chrome.tabs.update({url: '/edit.html?id=' + style.id});
if (!liveReload) { } else {
chrome.runtime.sendMessage({method: 'closeTab'}); BG.openEditor(style.id);
if (!liveReload) {
closeCurrentTab();
}
} }
window.dispatchEvent(new CustomEvent('installed')); window.dispatchEvent(new CustomEvent('installed'));