0

I have written the following code in the background.js file of an EDGE Extension:

browser.windows.create({"url": request.openUrlInEditor, "incognito": true});

It throws error saying 'incognito' property is not recognized/undefined. If I remove the 'incognito' property then it works - opens the window but not in private mode. As per the MDN API the 'incognito' property is suppose to work on EDGE. It is working with Firefox browser tho.

Rahatur
  • 3,147
  • 3
  • 33
  • 49

1 Answers1

0

On my Windows 10 machine build (17134.77) the following syntax works perfectly well:

browser.windows.create({"url": "https://www.example.com", "incognito": true});

However if you are on an older build please check the following syntax:

browser.windows.create({"url": "https://www.example.com", "inprivate": true});

Microsoft has changed the property from inprivate to incognito recently

WarPro
  • 350
  • 3
  • 5
  • @Rahatur I tried it out in the console of background page. – WarPro Jun 09 '18 at 12:45
  • Does it work if you put the code in the background page instead of console? – Rahatur Jun 11 '18 at 06:24
  • @Rahatur I think you are confused. There is a background page running if you have specified background key in the manifest file. When you go to edge actions pane > Extensions > "Your extension". On your extension' s details page you will have an option to inspect background page. When you click this you'll see a F12 Developer window show up. Now in this window there will be a console tab. I have tried the above code in this console – WarPro Jun 12 '18 at 06:57