Post

Replies

Boosts

Views

Activity

Safari Web Extension background request CORS issues
Hi, 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 - https://okta.box.com/s/q1zacdkeu3exe1ckxsba21l3kuhyzuby 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
11
0
13k
Jan ’23
WebExtension webRequest.onAuthRequired seems not working
Hi, I am trying the webRequest.onAuthRequired API on Safari WebExtension. From MDN document: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired, Safari WebExtension doesn't support extraInfoSpec After inspecting the background, the webRequest.onAuthRequired callback is triggered, but in the callback I return the credentials directly chrome.webRequest.onAuthRequired.addListener( function(details) { return { authCredentials: { username: 'username', password: 'password' } } }, { urls: ['<all_urls>'] } ); It still doesn't work, Any ideas to resolve this? Thanks a lot!
1
0
1.3k
Dec ’22
Can I open Safari Preference panel directly
Hi, I am developing a Safari Webextension, I would like to have some instructions on my app's splash screen. I put a button on the splash screen, when clicking it, my app will: open Safari. open Safari Preference panel. go to the "Extensions" tab in the preference panel I know #1's solution, but not sure how to achieve #2 and #3, Do you have any ideas? Thank you very much.
1
0
628
Nov ’21
Safari Web Extension background request CORS issues
Hi, 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 - https://okta.box.com/s/q1zacdkeu3exe1ckxsba21l3kuhyzuby 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://&lt;uuid&gt;"), 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
Replies
11
Boosts
0
Views
13k
Activity
Jan ’23
WebExtension webRequest.onAuthRequired seems not working
Hi, I am trying the webRequest.onAuthRequired API on Safari WebExtension. From MDN document: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired, Safari WebExtension doesn't support extraInfoSpec After inspecting the background, the webRequest.onAuthRequired callback is triggered, but in the callback I return the credentials directly chrome.webRequest.onAuthRequired.addListener( function(details) { return { authCredentials: { username: 'username', password: 'password' } } }, { urls: ['<all_urls>'] } ); It still doesn't work, Any ideas to resolve this? Thanks a lot!
Replies
1
Boosts
0
Views
1.3k
Activity
Dec ’22
Can I open Safari Preference panel directly
Hi, I am developing a Safari Webextension, I would like to have some instructions on my app's splash screen. I put a button on the splash screen, when clicking it, my app will: open Safari. open Safari Preference panel. go to the "Extensions" tab in the preference panel I know #1's solution, but not sure how to achieve #2 and #3, Do you have any ideas? Thank you very much.
Replies
1
Boosts
0
Views
628
Activity
Nov ’21