I am trying to create a Google Chrome custom theme (an image displayed on the new tab page). However there are these little last visited boxes blocking out part of the image, and try as I might, I can't find any extension or theme online which can get rid of them. I know what changes need to be made to achieve this; the HTML of the page contains this line:
<div id="mv-tiles" style="opacity: 1;"> == $0
and I just need to change style
to "opacity: 0;"
. I could do this with the static HTML from Excel (with getElementById("mv-tiles").style = "opacity: 0;"
or something like that)
But how do I do this dynamically, whenever I open the new tab page - not from Excel, just either with my .JSON file from the chrome theme, or with some addon?
Update
I just inserted the provided code into my JSON file as below - I then created a file in notepad where I pasted the JS code, saved it as content.js
. Finally I dragged the whole folder into the chrome extensions page to save it as a .crx pack, and then installed it. Here is my finished manifest.json
file:
{
"manifest_version": 2,
"permissions": [
"<all_urls>"
],
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"content.js"
],
"run_at": "document_end"
}
],
"theme": {
"images": [],
"colors": {
"frame": [
66,
116,
201
],
"toolbar": [
223,
223,
223
],
"tab_text": [
0,
0,
0
],
"tab_background_text": [
64,
64,
64
],
"bookmark_text": [
18,
50,
114
],
"ntp_background": [
255,
255,
255
],
"ntp_text": [
0,
0,
0
],
"button_background": [
0,
0,
0,
0
]
},
"tints": {
"buttons": [
0,
0,
0.5
]
},
"properties": {
"ntp_background_alignment": "bottom",
"ntp_background_repeat": "no-repeat"
}
},
"name": "Test Theme",
"version": "1",
"description": "Removes thumbnails"
}
It is not working as expected (the theme appears fine but the JS won't run!)