I use a toolbar button in Firefox to toggle between normal and private windows. Here is the code:
OpenBrowserWindow({private: !PrivateBrowsingUtils.isWindowPrivate(window)});
setTimeout(BrowserTryToCloseWindow, 80);
I use 'setTimeout' in order to prevent some flickering.
When the new window opens, it gets the focus. When the command 'BrowserTryToCloseWindow' is executed, the focus returns to the old window. When the old window is closed, the new one does have the focus, but it isn't 'checked / active' in Windows Task Bar.
I suppose I need to use ITaskbarList::ActivateTab in order to activate the new window in the task bar. I have the (very) basic direction:
Components.utils.import("resource://gre/modules/ctypes.jsm");
var lib = ctypes.open("user32.dll");
var taskBar = lib.declare(---
taskBar---
lib.close();
I'd appreciate your help.
Win 7, 32-bit, Classic Theme.