-
Notifications
You must be signed in to change notification settings - Fork 15
/
manifest.js
73 lines (72 loc) · 2.19 KB
/
manifest.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module.exports = function({
bundleName = 'My Extension',
bundleId = 'com.test.test.extension',
version = '1.0.0',
hosts,
bundleVersion = '1.0.0',
cepVersion = '6.0',
uiType = 'Panel',
width = '500',
height = '500',
cefParams = [
'--allow-file-access-from-files',
'--allow-file-access',
'--enable-nodejs',
'--mixed-context',
],
icon: { normal = '', rollover = '', darkNormal = '', darkRollover = '' },
}) {
var commandLineParams = cefParams.map(
cefParam => `<Parameter>${cefParam}</Parameter>`
);
return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="${bundleId}" ExtensionBundleName="${bundleName}" ExtensionBundleVersion="${bundleVersion}" Version="${cepVersion}">
<ExtensionList>
<Extension Id="${bundleId}" Version="${version}"/>
</ExtensionList>
<ExecutionEnvironment>
<HostList>
${hosts
.map(host => `<Host Name="${host.name}" Version="${host.version}" />`)
.join('\n ')}
</HostList>
<LocaleList>
<Locale Code="All"/>
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="${cepVersion}"/>
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
<Extension Id="${bundleId}">
<DispatchInfo>
<Resources>
<MainPath>./index.html</MainPath>
<CEFCommandLine>
${commandLineParams.join('\n ')}
</CEFCommandLine>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>${uiType}</Type>
<Menu>${bundleName}</Menu>
<Geometry>
<Size>
<Height>${height}</Height>
<Width>${width}</Width>
</Size>
</Geometry>
<Icons>
<Icon Type="Normal">${normal}</Icon>
<Icon Type="RollOver">${rollover}</Icon>
<Icon Type="DarkNormal">${darkNormal}</Icon>
<Icon Type="DarkRollOver">${darkRollover}</Icon>
</Icons>
</UI>
</DispatchInfo>
</Extension>
</DispatchInfoList>
</ExtensionManifest>`;
};