I've got a content script that works successfully when I load edmodo.com, but when I follow a link in the posts the script doesn't modify the new content. I know I've got to be missing something obvious, but I'm still learning how Chrome Extensions work. I appreciate any suggestions.
manifest.json
{
"name": "Spell Check Disabler",
"version": "1.0",
"description": "Prevents Chrome's spell check in text boxes on Edmodo.com",
"content_scripts": [
{
"matches": ["*://*.edmodo.com/*"],
"js": ["jquery-3.1.0.min.js","page.js"]
}
],
"permissions": [
"activeTab"
],
"manifest_version": 2
}
page.js
$(document).ready(function(){
console.log("DOM: " + Date()); //just checking to see if it loads
$("input").focus(function(){
$(this).attr('spellcheck', false);
});
$("input").blur(function(){
$(this).attr('spellcheck', false);
});
document.body.style.background = 'yellow'; //another indicator to see if it loaded
});
document.title = 'spellcheck disabled'; //another indicator to see if it loaded
The page background turns yellow, and remains yellow after I click a link, but the page title changes to reflect the new page and I don't get any new entries in the console.
I've tried fussing around with background scripts and chrome.webNavigation listeners to no success.
FWIW, the URL of the page starts as https://www.edmodo.com/home#/ and the link I click on includes a button that links to href="/home#/quiz/start/quiz_run_id/12078109"
Thanks -keen