I want to change youtube comments containing a certain keyword to something else, but to do that, I have to detect their text. I'm using a chrome extension with a manifest as follows:
{
"manifest_version": 2,
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab",
"https://ajax.googleapis.com/"
],
"content_scripts": [{
"css": ["styles.css"],
"js": ["content.js"],
"matches": ["https://*/*"],
"run_at": "document_end"
}]
}
and my content.js file is this:
alert("Starting");
Yet my alert goes off before the Youtube Comments or Messenger messages are loaded. How can I wait?