I have a chrome extension that I built that leaks memory. I am working on fixing the memory leak, but in the mean time a few friends are already using it.
As a temporary measure I want to include a patch which would restart the extension automatically, periodically.
How to do this?, namely restart a chrome extension from within the extension itself.
thanks,
You can have two extensions. And restart the target extension from the other. If that suits you read on.
content.js
background.js
manifest.json (parent)
manifest.json (child)
directory structure
Now open up
about:extensionsandhttp://localhostin split screen. Click on the button and see how the child extension is refreshed each time. Also you can check out the console. Even try to disable the child extension from withinabout:extensions– it’s not possible as long as the parent extension is running.