-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.json.js
54 lines (40 loc) · 1.08 KB
/
manifest.json.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* eslint-env node */
const { version } = require('./package.json')
const eventPage = {
page: 'src/module.html'
}
const serviceModule = {
service_worker: 'build/service.js',
type: 'module'
}
const firefoxSettings = {
browser_specific_settings: { gecko: { id: '[email protected]' } }
}
const permissions = ['tabs', 'storage']
const name = release => (release ? 'Yet Another Flags' : 'Yet Another Flags 🚧')
module.exports = ({ firefox, release } = {}) => ({
manifest_version: 3,
name: name(release),
short_name: 'YAFlags',
description: 'Shows country flag for the website near the location bar.',
...(firefox && firefoxSettings),
version,
background: {
...(firefox ? eventPage : serviceModule)
},
permissions: firefox ? ['dns', ...permissions] : permissions,
icons: {
128: 'img/icon/128.png',
48: 'img/icon/48.png',
32: 'img/icon/32.png',
16: 'img/icon/16.png'
},
action: {
default_icon: {
16: 'img/icon/16.png',
32: 'img/icon/32.png'
},
default_title: name(release),
default_popup: 'src/popup.html'
}
})