I'm trying my hand at a Chrome extension. On a "regular" page, I can seem to fetch whatever that is I need ( ('.myclass')
, for instance).
On an https page, it returns null. I'm loading jQuery from my extensions folder as mentioned here. I thought I was doing something wrong in my extensions code, but running $(this)
on a "regular" page ( such as SO homepage) returns all properties/methods, but on a a https page - this returns null.
Is jQuery not being injected into the page?
FTR: The https page I'm working on is Google Adsense. Below is the portion on my manifest.json
:
"background_page": "ga.html",
"content_scripts": [
{
"matches": ["https://www.google.com/adsense/*"],
"js": ["jquery.js", "cnt.js"]
}
],
"permissions": ["https://www.google.com/adsense/*"]
To add from comments: My cnt.js contains just this:
$(document).ready(function(){
alert('Hi!');
});
Strange thing is that the alert pops up before the page load is complete on Adsense page, which for other pages, it pops up after the load is complete