0

So... I am in the process of making a Chrome Browser extension as a practice assignment.

Right now, I have made a manifest.json file that contains a part like the following:

"content_scripts": [
    {
        "matches": ["<all_urls>"],
        "js": ["content.js"]
    }

]

The intention here is that for all sites opened via the Chrome browser, the content.js will be at work.

Before getting into what I intend to have the content.js as, I have made an index.html (image of it by clicking the 1 here)1

Also, I have made main.css and looks like the following:

html body {
    filter: grayscale(70);
}

Basically, index.html will be what the "New Tab" will look like. So, on that page, for example, if a user checkmarks "YouTube", I want the content.js to have something like: "If the YouTube checkmark is checked AND the website domain matches www.youtube.com, then apply main.css to that website's page"

Alexander Nied
  • 12,804
  • 4
  • 25
  • 45
  • Welcome to SO! I recommend all new users visit [ask] for tips on writing posts that best enable the community to provide assistance. Unfortunately, I believe your problem lacks a **clear question statement**; nowhere do you specify a problem that you are having, nor ask any question. Right now your post only contains a brief description of your project and goals. Without a problem or a question, there is really no "answer" that can be given. I'd recommend updating to specify what issue it is you are facing and all necessary context to understand the issue. Good luck & happy coding! – Alexander Nied May 25 '22 at 00:08
  • Does this answer your question? [Add stylesheet to Head using javascript in body](https://stackoverflow.com/questions/11833759/add-stylesheet-to-head-using-javascript-in-body) – DCR May 25 '22 at 00:12

0 Answers0