I am trying the new Safari WebExtension on Safari 14 beta on Majove, everything seems smooth so far except one thing:
The ajax request in the background will always fail since it is cross origin.
Here is the error image
This is not an issue on Chrome, and I think it make sense because the Web Extension background page's Origin is always the WebExtension protocol(like "chrome://<uuid>"), and should approve all the request even if the origin mismatch
But in Safari WebExtension it is not allowed. Even if I add the "Access-Control-Allow-Origin: *" header in the server's response header, the background page requests still fails.
The only way I can make it working is to disable the cross origin restrictions in the Develop menu, but that is not a solution for production.
Any advice to resolve this?
Thanks a lot
Also note, the GUID for Safari web extensions changes every launch of Safari to avoid website fingerprinting.