I'm developing a Safari web extension for macOS that calls SFSafariApplication.dispatchMessage()
(Swift) to communicate with background.js
and the popup. However, I noticed that the method forcefully switches Safari to foreground. It seems it happens after calling browser.runtime.sendNativeMessage('');
in JavaScript.
Is there a way to avoid that behavior? Or perhaps I'm misunderstanding something?
This is a sample project and its video (Safari is switched to foreground every 3 seconds.):
- Sample project: https://www.dropbox.com/s/vs7h128ef1ji34q/ForcefulForegroundIssuePlayground.zip?dl=0
- Video: https://www.dropbox.com/s/7pjbh1rihnh068l/Screen%20Recording%202021-12-23%20at%205.42.44%20pm.mov?dl=0
By the way, I already submitted a feedback for this as FB9804951 about 2 weeks ago but no response from Apple so far and I don't know if Apple will take any action for that or not even after the new year so I decided to ask here as well.