I believe in case with your extension it's reasonable solution. It's not what I would want, because it's not best practices I have found a "solution", that works all the time.
When I follow the steps, then close My Notes, background.html still becomes inactive after 15 seconds.
Maybe there is some difference in this mechanism on Mac and PC.
I've tested it on 3 different machines with totally different configurations on different networks (all Windows though). It can be 15 seconds (your case), or maybe 30 seconds (my case), or 5 seconds, 10 minutes, or on first tab, 80th, 120th. We can call it a fix and put in in 3.0.5. The solution is to make background page pernament. Only under rare circumstances should an extension have a persistent background, as they constantly consume system resources and can cause a strain on lower-powered devices. It's not what I would want, because it's not best practices.
It has to be problem with Chrome, because unless background page wasn't unloaded, there is no problem whatsoever. It all comes down to internally used which causes those problems, if it's the first thing run after the background page is loaded. If the first use would be opening Options instead, then the second use would be opening New Tab, while background page still loaded, then it would hinder the problem, it wouldn't occur. If the first use would be opening the New Tab, the background page would be loaded for the first time, and the problem with the address bar would happen. What will happen then, the extension will be "Inactive", until used again.
The 100% way how to reproduce this, is to disable the extension and enable it again (the blue button). That explains why it happened after you visited some other pages. Although you have 32 GB RAM, it still tries to allocate as much as it can, based on some rules. Can happen for any of the reasons above, as more memory resources are needed. "Inactive" means the background page (with a script inside) was unloaded.
It turns out, it can be 15 seconds (your case), or maybe 30 seconds (my case), or 5 seconds, 10 minutes, or on first tab, 80th, 120th. I followed the steps for about 10 times, every time the address bar was selected. It made it crystal clear where the root of the problem is. I hope Google is reading this Thanks a lot for these steps. The ideal would be, if the extension installed for the development, could have a custom ID, an ID that I could set on 2 computers. As example, functionality that is bound to the extension's ID. Therefore even my best efforts are challenged. An example: client_id required by Google Drive, which is different for the published My Notes, and for My Notes developed locally.Īnother limitation is, there is no way to test some things, unless published. The other limitation is, an inability to use a variable in the manifest.json which makes it hard to maintain different settings for other environments, without bringing a build step into the play. Me personally, I prefer CTRL + SHIFT + M but want to support both solutions (new tab override enabled, new tab override disabled). That's how it was in the past, but it has one huge drawback - it was a setting that couldn't be optional. This limitation doesn't happen if new tab is overriden declaratively (in manifest.json). It would be great, if this could be solved as well.