We have been shipping a Chrome extension since the beginning, year 2011 or whatever. The extension works with our macOS native bookmarks management app, giving it access to Chrome bookmarks via Native Messaging. Our native app can read and write Chrome bookmarks, and is notified whenever bookmarks are changed in Chrome, thanks to chrome.bookmarks.xXXXXXX.addListener.
For pushing bookmarks changes into Chrome, our extension is expected to respond to messages from the native app, even when there is no browser window open in Chrome. (Chrome always opens a browser window upon launch, but the user may close it.) I'm pretty sure this worked in older versions of Chrome, and it still works in Edge, Firefox, and Opera. But in recent versions of Chrome, our extension does not respond to Native Messages unless there is at least one browser window open. I suspect this behavior is collateral damage from the depracation of background scripts in favor of Service Workers.
Our extension has a manifest V2 and a background.page. I understand that we must migrate to manifest V3 and am working through that. I understand how to migrate our background.page to a background.script, eliminating the background.html page. The next step would be to migrate the Background Script into a Service Worker. I have read the documentation explaining how Listeners must be installed synchronously.
But I'm wondering, will this work in the end? Do Service Workers support responding to events like Native Messaging when no browser windows are open?
Probably our requirement is relatively rare. Thank you.