Reputation: 28379
I'm writing my first Chrome packaged app and as per the documentation adding
"content_scripts": [
{
"js": ["app.js"]
}
],
this produces a chrome error that says: "There were warnings when trying to install this extension: 'content_scripts' is only allowed for extensions and legacy packaged apps, but this is a packaged app."
I have no idea what this means, but more importantly, I don't understand how I am to define the scripts in the js/ folder so that the app actually sees them and loads them.
Upvotes: 0
Views: 391
Reputation: 3740
JavaScript files are in the same directory tree as the rest of the app (the root of that tree contains manifest.json) and they are referenced from SCRIPT tags in the HTML file. In addition, the manifest must have a background.scripts property that references the JavaScript file(s) for the event page. (This property is what makes it an app, as opposed to something else, such as an extension.) The event page is required; HTML associated with windows is optional, only present if you want one or more windows.
Upvotes: 2