I converted an extension from Chrome to Safari using:
xcrun safari-web-extension-converter
All works except for one thing: when trying to access the localStorage or sessionStorage from background script I get:
SecurityError: the operation is insecure.
It works in all other browsers (chrome, firefox, edge) - but not here. I hope that the solution is to turn on some flag in the xcode build settings and not to try and implement some native swift code - which I (and many other developers) will not do.
Any solution?
Where are you trying to store session data? You mentioned your background script, but it is unclear if you are trying to set session data for the background page, popup, extension page or on a webpage via content script.
I said - background script. In the manifest file of browsers extension (chrome, firefox, edge) you have the manifest.json in which you define what is the background script. After I converted the extension to a Safari extension, Any access from the background script to window.sessionStorage was denied, which is extremely weird. Should I configure anything in the Xcode project after the conversion to solve that problem? Is it a Safari converter bug? Anything else?
Anybody home?