diff background.js @ 11:5d7914307782

Allow reopening tabs from normal windows in incognito windows Moving a tab from a normal window to a window in incognito mode does not work, it result in a new empty tab. Thus, allow reopening instead of moving such tabs.
author Guido Berhoerster <guido+tab-mover@berhoerster.name>
date Mon, 20 Feb 2017 17:40:31 +0100
parents 2a87d7a3863f
children e32b90567f39
line wrap: on
line diff
--- a/background.js	Mon Feb 20 17:00:03 2017 +0100
+++ b/background.js	Mon Feb 20 17:40:31 2017 +0100
@@ -182,7 +182,7 @@
         let windowInfo = this.model.getWindow(windowId);
         let incognito = this.model.getWindow(focusedWindowId).incognito;
 
-        if (incognito && !windowInfo.incognito) {
+        if (incognito !== windowInfo.incognito) {
             this.reopenMenuIds.add(menuId);
         } else {
             this.moveMenuIds.add(menuId);
@@ -192,7 +192,7 @@
             id: menuId,
             title: windowInfo.title,
             contexts: this.menuContexts,
-            parentId: (incognito && !windowInfo.incognito) ?
+            parentId: (incognito !== windowInfo.incognito) ?
                 'reopen-menu' : 'move-menu'
         }).then(() => {
             return this.enableMenus();
@@ -255,7 +255,7 @@
                 }
 
                 let menuId = String(windowInfo.id);
-                if (incognito && !windowInfo.incognito) {
+                if (incognito !== windowInfo.incognito) {
                     this.reopenMenuIds.add(menuId);
                 } else {
                     this.moveMenuIds.add(menuId);
@@ -266,7 +266,7 @@
                     id: menuId,
                     title: windowInfo.title,
                     contexts: this.menuContexts,
-                    parentId: (incognito && !windowInfo.incognito) ?
+                    parentId: (incognito !== windowInfo.incognito) ?
                         'reopen-menu' : 'move-menu'
                 }));
             }