itayhac I've submitted a FB as FB8735832, but there has been no activity on it since my original submission on September 2020
Post
Replies
Boosts
Views
Activity
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
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
	}
});
Also seeing the same problem reported by our users and reproducible locally. Any info would be greatly appreciated.
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.
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
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).