I'm writing a Google chrome extension in which I parse the <head>
tags of any page loaded and look for a specific <meta>
tag. A content script is used to communicate with the site, the actual logic is then done in a background script.
The question is when the background script should ask the content script to check the <meta>
tags. chrome.webNavigation.onDOMContentLoaded
seems to be on the safe side, but I found that often this event is fired multiple times across when loading a page. Also, the <head>
might be available before chrome.webNavigation.onDOMContentLoaded
hits. That all brings me to the question:
How do I best check when the <head>
section of a page is loaded?