Open tab in Incognito Mode

I’m using this code to create a new tab in Firefox 57

        let mirror = browser.windows.create({
            url: profiler.url + "?profiler=" + i,
           state: "fullscreen"
        });    

        mirror.then((docking) => { 
        let updateInfo = {
          left : x,
          width : screen.width,
          height : screen.height
        };

        browser.windows.update(docking.id, updateInfo); 
      });

This addons will integrated with MicroStartegy Application, but every time we using the code above. The user session will cross join or sharing. I means, If one tab logging out, the others tab will log out also. How to avoid this things?

It seem the session at MicroStrategy Application looks at the browser ID. Instead of that, its works well on Chrome because for every tab on Chrome, Chrome will open new application. I’ve checks on task manager.

So I think the best solution is how to open in Incognito mode. How to open in Incognito mode?

Or any better idea instead using Incognito Mode?

Any idea would be appreciated.

The best solution would be to use a unique container, which you can create with https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextualIdentities and then pass to the window. This would allow you to keep sessions for multiple accounts between the tabs/windows being opened.

Alternatively you can open the window in incognito mode like you can in Chrome, which you do not seem to be doing in your code.

@freaktechnik If you check my code, I used browser.windows.create to attach a new windows as fullscreen, I’ve check https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create there are no state to define a new tab as a fullscreen. Any idea?

If fullscreen means to have a maximized window, the browser.windows.create is the correct API to use, as in, you create a window and not a tab. If you want your whole window to be in private mode (which is the only way to have private mopde tabs at the moment, afaik), you’d have to pass that to browser.windows.create: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/windows/create

@freaktechnik Yes, if you check this document you can state a new window as a full screen right? I’ve check If we open a new tab as an Incognito mode then the session still sharing one each other. Any idea regarding this case? Is it browser.tabs.create cannot set a state as a full screen?

Thanks @freaktechnik