Currently I am keeping track of the open tabs, and checking if the domain of the tab changes, and then injecting my local storage content script.
This currently only handles browser url changes, but it would probably be preferable to do this for iframes, especially because iframes are often used for ads and tracking.
I believe chrome.tabs.onUpdated will fire if an iframe is updated, but it doesn't look like it will give you any information about the iframes in the page.
To handle this correctly it may be necessary to inject a content script to find all iframes and set the persistent storage data in them. However I couldn't use the convenient system I am using now for the main page, so it would probably be very messy and a lot of work.
Is there a way to mine already-stored data? This will limit what you can sync to sites that are actually visited, not only those that are potentially visited (or were visited before the extension was installed).
Currently I am keeping track of the open tabs, and checking if the domain of the tab changes, and then injecting my local storage content script.
This currently only handles browser url changes, but it would probably be preferable to do this for iframes, especially because iframes are often used for ads and tracking.
I believe chrome.tabs.onUpdated will fire if an iframe is updated, but it doesn't look like it will give you any information about the iframes in the page.
To handle this correctly it may be necessary to inject a content script to find all iframes and set the persistent storage data in them. However I couldn't use the convenient system I am using now for the main page, so it would probably be very messy and a lot of work.