adambullmer / vue-cli-plugin-browser-extension

Browser extension development plugin for vue-cli 3.0
GNU Lesser General Public License v3.0
427 stars 76 forks source link

Content script entry missing from manifest.js #41

Closed franciscolourenco closed 5 years ago

franciscolourenco commented 5 years ago

On a new project, selecting the content script option during generation, the content-script option is missing from manifest.json.

https://github.com/reproducing/vue-cli-plugin-browser-extension-manifest-content-script/blob/master/src/manifest.json


EDIT: there is also some indentation issue in this line

adambullmer commented 5 years ago

When the manifest is scaffolded with a content script, the activeTab permission is added to the manifest. This is a default based on google's docs on how to use content scripts. As it stands right now, there isn't really a one size fits all scaffold, and this was the lest opinionated option to add to your manifest out of the box.

What were you expecting to show up in the manifest file? Always possible something important is missing.

franciscolourenco commented 5 years ago

I was expecting the content_scripts option. As you said they both options are ways of executing content scripts.

  "content_scripts": [
    {
      "matches": ["*://*/*"],
      "js": ["content_scripts/content.js"]
    }
  ],

This would be quite permissive, but at the same time the scaffold already includes

  "permissions": [ 
    "<all_urls>",
    "*://*/*"
  ]

If you keep it like it is, it would already be useful adding your explanation to the readme.

franciscolourenco commented 5 years ago

Closing this