Home > database >  Chrome extension wont load images
Chrome extension wont load images

Time:11-01

This is my mainfest.

{
  "name": "CVAT FlowChart",
  "version": "0.01",
  "description": "Easier access to flow charts for QA",

  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "css": ["./style.css"],
      "web_accessible_resources": [{
        "resources": ["Images/singleimage.png"],
        "matches": ["<all_urls>"]
      }],
      "js": [ "jquery.js", "contentScript.js", "string.js" ]
    }
    
  ],
  "background": {
    "service_worker": "background.js"
  },


  "host_permissions": ["<all_urls>", "http://localhost/*"],
  "manifest_version": 3
}

I know I am using the correct src in my js file, because I can get there by following the link that I am imputing. what is wrong with my mainifest. Is there another place that could be the source of my problem?

this is the error I am getting. enter image description here

CodePudding user response:

Put web_accessible_resources at the same level as content_scripts. I think your manifest.json is a format error. It would be a bug not to be able to detect it.

manifest.json

{
  "name": "CVAT FlowChart",
  "version": "0.01",
  "description": "Easier access to flow charts for QA",
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "css": [
        "./style.css"
      ],
      "js": [
        "jquery.js",
        "contentScript.js",
        "string.js"
      ]
    }
  ],
  "web_accessible_resources": [
    {
      "resources": [
        "Images/singleimage.png"
      ],
      "matches": [
        "<all_urls>"
      ]
    }
  ],
  "background": {
    "service_worker": "background.js"
  },
  "host_permissions": [
    "<all_urls>",
    "http://localhost/*"
  ],
  "manifest_version": 3
}
  • Related