Search code examples
cssgoogle-chrome-extension

CSS Not loading in chrome extension


I'm trying to inject custom css onto a website. I keep getting a error message

Failed to load extension
File
C:\Users\username\Desktop\Mineplex+
ErrorCould not load css '' for content script.

manifest.js:

  "name": "Mineplex+",
  "author": "UCYT5040",
  "version": "1.0",
  "manifest_version": 3,
  "background": {
    "service_worker": "background.js"
  },
  "permissions": ["scripting", "tabs", "https://*.mineplex.com", "http://*.mineplex.com/*"],
  "content_scripts": [
    {
      "matches": ["https://*.mineplex.com/*"], 
      "css" : ["https://Better-Mineplex-Forums.ucyt5040.repl.co/style.css"]
    }
    ],
  "action": {}
}

Solution

  • @wOxxOM answered as a comment.

    css should contain a local path inside the extension, not an external URL. Download style.css and place it inside the extension, then specify style.css in css key.