mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
write background property to manifest dynamically
This commit is contained in:
parent
3fc3d01d17
commit
5bf7a70694
@ -4,10 +4,6 @@
|
|||||||
"short_name": "Sample Name",
|
"short_name": "Sample Name",
|
||||||
"description": "Sample description",
|
"description": "Sample description",
|
||||||
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
||||||
"background": {
|
|
||||||
"persistent": false,
|
|
||||||
"scripts": ["js/background.js"]
|
|
||||||
},
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"minimum_chrome_version": "49",
|
"minimum_chrome_version": "49",
|
||||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||||
|
|||||||
@ -4,9 +4,6 @@
|
|||||||
"short_name": "Sample Name",
|
"short_name": "Sample Name",
|
||||||
"description": "Sample description",
|
"description": "Sample description",
|
||||||
"homepage_url": "https://github.com/abhijithvijayan/kutt-extension",
|
"homepage_url": "https://github.com/abhijithvijayan/kutt-extension",
|
||||||
"background": {
|
|
||||||
"scripts": ["js/background.js"]
|
|
||||||
},
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||||
|
|||||||
@ -6,10 +6,6 @@
|
|||||||
"short_name": "Sample Name",
|
"short_name": "Sample Name",
|
||||||
"description": "Sample description",
|
"description": "Sample description",
|
||||||
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
||||||
"background": {
|
|
||||||
"persistent": false,
|
|
||||||
"scripts": ["js/background.js"]
|
|
||||||
},
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"minimum_opera_version": "36",
|
"minimum_opera_version": "36",
|
||||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||||
|
|||||||
@ -37,12 +37,15 @@ module.exports = {
|
|||||||
{ from: 'src/assets', to: 'assets' },
|
{ from: 'src/assets', to: 'assets' },
|
||||||
{
|
{
|
||||||
from: `src/manifests/${process.env.TARGET}.json`,
|
from: `src/manifests/${process.env.TARGET}.json`,
|
||||||
// expose and write the allowed env vars on the compiled bundle
|
|
||||||
transform(content, path) {
|
transform(content, path) {
|
||||||
// generates the manifest file using the package.json informations
|
// generates the manifest file using the package.json informations
|
||||||
return Buffer.from(
|
return Buffer.from(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
version: process.env.npm_package_version,
|
version: process.env.npm_package_version,
|
||||||
|
background: {
|
||||||
|
persistent: false,
|
||||||
|
scripts: ['js/background.bundle.js'],
|
||||||
|
},
|
||||||
...JSON.parse(content.toString()),
|
...JSON.parse(content.toString()),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user