sutaka
sutaka

Reputation: 41

How can i open a new private window using safari extension?

I'm now converting my chrome extension to safari extension.

My chrome extension uses the API to open a new private window like this.

chrome.windows.create({"url": url, "incognito": true});

Does anyone know the way to implement this functionality in safari extension?

I tried looking it up, but I could only find the way to open a normal window as below. safari.application.openBrowserWindow();

Upvotes: 4

Views: 1167

Answers (1)

breakingobstacles
breakingobstacles

Reputation: 2855

As of Safari 10.0 and macOS 10.12, there is no public API to accomplish this.

For Safari Extensions written in Javascript, the private attribute of SafariBrowserTab is read-only.

For Safari App Extensions (new in Safari 10), the usesPrivateBrowsing property of SFSafariPageProperties is also read-only.

Either of the above can only be used to query the private browsing state of a tab.

And the respective open window and open tab methods (for Safari Extensions JS and Safari App Extensions) do not currently provide any ability to configure private browsing mode either.

Upvotes: 3

Related Questions