I have created a simple Jquery script as an chrome extension that are suppose to change the font color of a class.
the script is working fine if I use it directly in the console. but if I run it as an extension It wont trigger when the value is higher than one.
Any suggestion of what could be the problem?
Script.js
(function(){
$("#ID-layout-1435216276773-counterValue").each(function() {
var el = $(this);
var value = parseFloat(el.text());
if (value > 1) {
el
.css("font-weight", "bold")
.css("color", "red");
} else {
el.css("font-weight", "normal");
}
});
})();
Manifest
{
"update_url": "https://clients2.google.com/service/update2/crx",
"name": "Live",
"version": "0.3",
"description": "Live",
"permissions": [
"tabs","<all_urls>"
],
"browser_action": {
"default_icon": "icon.png"
},
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon_128.png"
},
"content_scripts": [
{
"matches": [
"https://www.google.com/analytics/web/?hl=en#dashboard/6I8yfVs_TqSQ_b1tOJYR0Q/a8398197w15972131p74378741/*"
],
"run_at": "document_end" ,
"js": ["script.js"]
}
],
"manifest_version":2
}