I am developing a manifest v3 Chrome extension, with Native Messaging implemented in a Service Worker. If I load this extension unpacked into Google Chrome 116, then close all windows in Chrome, the Native Messaging process exits and, of course, native messages fail. This same unexpected exit now occurs for users with the currently shipped manifest v2 version of my extension. (Of course, the manifest v2 version has Native Messaging implemented in a Background Page.)
I am quite certain that such unexpected exits did not occur in earlier versions of Chrome, several years ago, and definitely these exits are not seen in current versions of other Chromium-based browsers such as Microsoft Edge. With my same shipped extension installed in Microsoft Edge, Native Messaging continues to work even if all Edge windows are closed.
This new behavior causes an edge case bug for extensions such as, for example, bookmarks syncing. Users may close all browser windows but still expect their bookmarks to be synced via Chrome Sync to Chrome on other devices.
The issue does
not seem to be that my Service Worker is becoming
inactive. My manifest v3 extension calls `chrome.runtime.onStartup.addListener(() => {});` as
correctly suggested in another conversation. After one of these unexpected exits has occurred, if I open a browser window, a new Native Messaging process is launched, and native messaging resumes working. The
Extensions window does not ever indicate that my Service Worker is
inactive.
A possible workaround is that if my native app gets no response and/or AppleScript says that Chrome has no windows open, my native app could quit and relaunch Chrome, or defer the syncing until later. This would "fix" the problem because Chrome always opens a window upon launching. But such a kludge would be dangerous, fragile and annoying to the user.
What is the best way to get some attention to this issue? Is there a better place to report it than in Google Chrome > main menu > Help > Report an Issue ?