I am super close to getting my Chrome Extension running perfectly, but am running into one last issue now.
The problem seems to be related to the content script being injected repeatedly on sites like Facebook, where the entire page is not reloaded upon clicking a link, etc...
I think the issue is related to the site being very AJAX-dependent.
If I refresh the entire page, or load it for the first time, then there is no problem. My extension runs and the content script is injected properly.
However, if I load the page the initial time, then click on a link on the site, the "content section" of Facebook will load whatever link you clicked on, while the floating blue navigation bar at the top doesn't refresh or change at all.
I.E. the entire page does not reload. Since both the "content section" of the site and the navigation bar are both in the same frame, the content script just keeps getting injected another time for every link you click.
So eventually I see in my console log that it's running 2X, 3X, 4X, 5X etc.. As I click around on more links, the number increases by 1 each time.
So my question is this:
Is there a simple way to check if the content script is ALREADY present/active before injecting it again? Or what else can be used as a work-around for a situation like this?