1

Im currently developing a Google Chrome extension. At the moment I am appending a to the of a wesbite this way inside my content.js file:

$('html').append('<section id="bse-ce">content</section>');

But as the HTML markup grows its gonna be annoying having to maintain the HTML as a JavaScript string. Therefore I have created a content.html and I would like to get its content and append it to the same as before through this method:

$.get(chrome.runtime.getURL('../html/content.html'), function(data) {
    $(data).appendTo('html');
});

Inside my manifest.json im "whitelisting" the html file:

"web_accessible_resources": [
   "html/content.html"
],

But everytime I try to reload my extension I get the following error:

Error at key 'web_accessible_resources'. Parsing array failed at index 0: expected dictionary, got string

Im running manifest version 3. Does my error solely lay within the definition of the web_accessible_resources? For me it seems to be defined correct.

Mikkel Fennefoss
  • 857
  • 1
  • 9
  • 32
  • 1
    https://stackoverflow.com/questions/66636403/manifest-v3-resources-must-be-listed-in-the-web-accessible-resources – Teemu Sep 27 '21 at 12:58
  • Before switching to MV3 make sure to see its [migration guide](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/) that lists the changes. – wOxxOm Sep 27 '21 at 13:54

0 Answers0