0

My content script work only when the webpage is reload, on the youtube webpage when clicking on 'a' element of a video the content scripts don't load

This is the content script property saved in manifest:

"content_scripts": [
    {
      "matches": [
        "*://*.youtube.com/*"
      ],
      "js": ["services/youtube.js"],
      "run_at": "document_end"
    }
  ],

2 Answers2

0

matches looks like an array of regular expressions,

js looks like an array of URLs (website addresses),

and run_at looks like a command to the sub-system, a command to the part of the code that uses this particular example.

0

I found the awnser by using chrome.webNavigation.onHistoryStateUpdated.addListener() and chrome.tabs.executeScript()