简体   繁体   中英

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();

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM