Safari now can use web extensions.
But browser.identity
or chrome.identity
is not supported. So launchWebAuthFlow
is not working.
In the docs they just say.
identity Not supported. Initiate an OAuth flow in a new tab.
How can I do it? Is there any example?
It currently seems not possible to implement a OAuth flow in a safari web extension.
There's an Apple Developer thread with a workaround involving redirecting to a random URL and intercepting this in
webRequest.onBeforeRedirect
, but it appears to be broken as of Safari 15.4: https://developer.apple.com/forums/thread/6701652021:
2023:
The OP has created a webkit bug report you may find useful: https://bugs.webkit.org/show_bug.cgi?id=256054