safari web extensions cannot carry cookies through jquery ajax in popup scripts. I found that it is possible in Chrome, but when converted to run on Safari using safari-web-extension-converter, the ajax requests do not pass the cookie over. Is there any way to solve this problem?
Post
Replies
Boosts
Views
Activity
My Chrome extension runs fine on Chrome, but when I use the following command to run it on Safari, I find that the result returned by chrome.runtime.sendMessage is always Undefined.
xcrun safari-web-extension-converter --app-name MySafariTest dist
The following is my code content.js:
async test() {
return chrome.runtime.sendMessage({
method: "test"
})
}
let result = await this.test()
// result is always undefined
background.js:
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
sendResponse("test123")
});
I want to know if there is any way to make the content script and background script of Chrome communicate normally in Safari?
My safari plugin login verification is based on cookies. I found that as long as the plugin is used for a period of time, refreshing the page and making another request will result in the loss of cookies. I want to know if there are any other ways besides changing the login verification method to bypass cookies?