Post

Replies

Boosts

Views

Activity

Reply to Authenticate Safari Extension with Web Application
Ok I managed to solve the problem :OO Leaving the answer to someone that may have same problem in the future :D In my manifest file I had to change background.service_worker to background.scripts. Apparently service_worker runs on the separate thread and has limited browser context hence no access to the cookies If you use background.scripts instead it will make extension generate persistent background page that has a possibility to pickup the cookies :D Everything works out of the box now :D
Aug ’24
Reply to Authenticate Safari Extension with Web Application
Thanks for response. This will mean that I have to start develop in swift which I am trying to avoid. I found other very similar extension that seems to work the same way. The difference that I see between ours is that when I enter Develop > Web Extension Background Content: 3rd Party Extension I can see generated_background_page.html in the Sources Tab that loads the background script. I can also see all the devtools tabs like on any other website. In Networking tab can see all the requests made. Interesting thin is that if I make the fetch request from the Console of this background script to our service... the cookie gets attached automatically and I am able to use the api. My Extension While when I enter background script of my extension I can see only three dev tools tabs: Console, Network and Sources. In Sources I have only service-worker.js file and none of html files. On the Network tab I can't see any requests send for example when I open extension popup yet.. in Console I can see all the errors returned by the requests that were send - all return unauthorised. Can it be that the way background content is loaded is reason to not detect the cookies? How can I make my background composed of html file loading script?
Aug ’24