Hi there,
I'm using chrome.tabs.onUpdated.addListener to re-inject a content script into the active tab every time the URL changes.
I notice that when I move between certain URLs:
Example 1 -
Moving from:
to
Example 2-
Moving from:
To:
(Normal checkout flows).
It does not properly re-inject the content script each time. I have console.logs that should run each time the content script is re-injected and these do not run.
Here is an example of the code:
I can tell it runs because the tab ID does log each time the URL in the browser changes as I move through that ulta checkout or the adidas checkout, but, the logs I have set up in the content.js do not fire off every time, so, it is not actually being reinjected.
I have tried setting up a catch to log if there is an injection problem as well, but nothing comes back.
If I hit refresh - it injects properly.
I have been trying to figure this out for days and I'm completely stumped - I have noticed other plugins have the same issue including big plugins with major dev teams such as Honey.
Does anyone know where I'm going wrong?