Posts

Post not yet marked as solved
3 Replies
Anyway, is this the right place to report bugs? This is 100% a bug. I don't know, but I assume it is as good a place as any. See my response to your question - https://developer.apple.com/forums/thread/659681?answerId=634052022#634052022, if you only need top frame responses there is a solution for your issue
Post marked as solved
2 Replies
You can get the responses to work by using the sendResponse callback. If you look at the browser compatibility table for onMessage listener - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#Browser_compatibility you will see that responses via promises only natively work on Firefox (and if you're using a browser. polyfill then the promise response works for chrome too). You can do something like this for safari: browser.runtime.onMessage.addListener((message, sender, sendResponse) => { 	if (x === 'hello') { 		console.warn(x); 		performAsyncOperation(function callback() { sendResponse('ok') }) 		// need to return true if you plan on sending a response asynchronously 		return true; 	} 	if (x === 'bye') { 		sendResponse('ok') 		// no need to return anything here, since we send the response synchronously 	} });
Post not yet marked as solved
3 Replies
You are asking about something else and I answered you in your topic, but as for my own question, we have now deployed the extension to a beta branch of our users and the background process does not seem to be killed all that often (or possibly at all). I don't know if this will change in the future but for now it works well.
Post not yet marked as solved
3 Replies
I don't know if you have found this yet, but closing every 30 seconds thing is answered here https://stackoverflow.com/a/56733433/3199106It supposedly doesn't kill the background process in production that quickly
Post not yet marked as solved
1 Replies
The first docs you linked are for the deprecated Safari extension framework (unavailable since Safari 13). You should use the docs in the second link. You can tell whether you are in old or new docs based on the layout of the docs (if you get there e.g. via a Google search).