Skip to content

Commit e916520

Browse files
author
priyank
committed
Added scripts to create a build for the Kiwi browser
1 parent ecf1bde commit e916520

8 files changed

+78
-5
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ extension-dist/
2929
extension-chrome/
3030
extension-edge/
3131
extension-firefox/
32+
extension-kiwi/
3233
extension-opera/

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ extension-edge.zip
55
extension-edge/
66
extension-firefox.zip
77
extension-firefox/
8+
extension-kiwi.zip
9+
extension-kiwi/
810
extension-opera.zip
911
extension-opera/
1012

extension/manifest-generator.mjs

+7-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var generateManifest = function (whichBrowser) {
4343
"scripting",
4444
"offscreen"
4545
];
46-
if (whichBrowser === "firefox") {
46+
if (whichBrowser === "firefox" || whichBrowser === "kiwi") {
4747
permissions.push("webNavigation");
4848
// permissions.push("<all_urls>");
4949
} else if (whichBrowser === "puppeteer") {
@@ -60,7 +60,9 @@ var generateManifest = function (whichBrowser) {
6060

6161
"optional_permissions": (function () {
6262
var optional_permissions = [];
63-
if (whichBrowser !== "firefox") {
63+
if (whichBrowser === "firefox" || whichBrowser === "kiwi") {
64+
// do nothing
65+
} else {
6466
optional_permissions.push("webNavigation");
6567
// optional_permissions.push("<all_urls>");
6668
}
@@ -168,6 +170,7 @@ var generateManifest = function (whichBrowser) {
168170
switch (whichBrowser) {
169171
case "edge":
170172
case "firefox":
173+
case "kiwi":
171174
case "opera":
172175
case "puppeteer":
173176
break;
@@ -182,6 +185,7 @@ var generateManifest = function (whichBrowser) {
182185
case "chrome": targetFileName = "manifest-chrome.json"; break;
183186
case "edge": targetFileName = "manifest-edge.json"; break;
184187
case "firefox": targetFileName = "manifest-firefox.json"; break;
188+
case "kiwi": targetFileName = "manifest-kiwi.json"; break;
185189
case "opera": targetFileName = "manifest-opera.json"; break;
186190
case "puppeteer": targetFileName = "manifest-puppeteer.json"; break;
187191
default: targetFileName = "manifest.json"; break;
@@ -195,5 +199,6 @@ generateManifest("default");
195199
generateManifest("chrome");
196200
generateManifest("edge");
197201
generateManifest("firefox");
202+
generateManifest("kiwi");
198203
generateManifest("opera");
199204
generateManifest("puppeteer");

extension/manifest-kiwi.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"version": "8.22.4",
3+
"manifest_version": 3,
4+
"author": "Priyank Parashar",
5+
"default_locale": "en",
6+
"name": "__MSG_Extension_Name__",
7+
"description": "__MSG_Extension_Description__",
8+
"homepage_url": "https://github.com/webextensions/live-css-editor",
9+
"icons": {
10+
"16": "icons/icon-16.png",
11+
"24": "icons/icon-24.png",
12+
"32": "icons/icon-32.png",
13+
"40": "icons/icon-40.png",
14+
"48": "icons/icon-48.png",
15+
"128": "icons/icon-128.png",
16+
"256": "icons/icon-256.png"
17+
},
18+
"permissions": [
19+
"activeTab",
20+
"storage",
21+
"unlimitedStorage",
22+
"scripting",
23+
"offscreen",
24+
"webNavigation"
25+
],
26+
"optional_permissions": [],
27+
"optional_host_permissions": [
28+
"*://*/*"
29+
],
30+
"action": {
31+
"default_icon": {
32+
"16": "icons/icon-16.png",
33+
"24": "icons/icon-24.png",
34+
"32": "icons/icon-32.png",
35+
"40": "icons/icon-40.png",
36+
"48": "icons/icon-48.png",
37+
"128": "icons/icon-128.png",
38+
"256": "icons/icon-256.png"
39+
},
40+
"default_title": "Launch Magic CSS editor for this page"
41+
},
42+
"background": {
43+
"service_worker": "dist/background-magicss/background-magicss.bundle.js"
44+
},
45+
"commands": {
46+
"_execute_action": {
47+
"suggested_key": {
48+
"default": "Alt+Shift+C"
49+
}
50+
}
51+
},
52+
"options_ui": {
53+
"open_in_tab": true,
54+
"page": "options.html"
55+
},
56+
"content_security_policy": {
57+
"extension_pages": "script-src 'self'; object-src 'self'"
58+
},
59+
"offline_enabled": true
60+
}

notes-for-developers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to load the extension in development mode
22

3-
## For Chrome / Chromium / Edge / Opera
3+
## For Chrome / Chromium / Edge / Kiwi / Opera
44

55
- Load the unpacked extension via ```manifest.json``` from the ```extension/``` folder
66

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
"zip:extension:chrome": " node ./zip-extension.mjs chrome",
2525
"zip:extension:edge": " node ./zip-extension.mjs edge",
2626
"zip:extension:firefox": "node ./zip-extension.mjs firefox",
27+
"zip:extension:kiwi": " node ./zip-extension.mjs kiwi",
2728
"zip:extension:opera": " node ./zip-extension.mjs opera",
28-
"zip:extension": "npm run zip:extension:chrome && npm run zip:extension:edge && npm run zip:extension:firefox && npm run zip:extension:opera",
29+
"zip:extension": "npm run zip:extension:chrome && npm run zip:extension:edge && npm run zip:extension:firefox && npm run zip:extension:kiwi && npm run zip:extension:opera",
2930
"publish:build-and-zip": "npm run clean && npm run start:build:publish && npm run zip:extension",
3031
"get-latest-reviews": "node ./scripts/recipes/get-latest-reviews.mjs"
3132
},

scripts/version-consistency-check.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ var mismatchFound = matchVersions(
6868
'../extension/manifest-chrome.json',
6969
'../extension/manifest-edge.json',
7070
'../extension/manifest-firefox.json',
71+
'../extension/manifest-kiwi.json',
7172
'../extension/manifest-opera.json',
7273
'../live-css/default.live-css.config.js',
7374
'../extension/scripts/appVersion.js'

zip-extension.mjs

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const __dirname = path.dirname(import.meta.url).replace('file://', '');
1414
var processCommand = process.title + ' ' + path.relative(__dirname, process.argv[1]);
1515
console.log(chalk.gray([
1616
'',
17-
'Format: ' + processCommand + ' [chrome/edge/firefox/opera]',
17+
'Format: ' + processCommand + ' [chrome/edge/firefox/kiwi/opera]',
1818
'Examples: ' + processCommand,
1919
' ' + processCommand + ' chrome',
2020
' ' + processCommand + ' edge',
@@ -28,6 +28,7 @@ switch (whichBrowser) {
2828
case 'chrome': zipFileName = 'extension-chrome.zip'; break;
2929
case 'edge': zipFileName = 'extension-edge.zip'; break;
3030
case 'firefox': zipFileName = 'extension-firefox.zip'; break;
31+
case 'kiwi': zipFileName = 'extension-kiwi.zip'; break;
3132
case 'opera': zipFileName = 'extension-opera.zip'; break;
3233
default:
3334
console.log(chalk.red('Error: Please pass a supported browser name as parameter (or no parameters)'));
@@ -84,6 +85,7 @@ try {
8485
case 'chrome': return 'manifest-chrome.json';
8586
case 'edge': return 'manifest-edge.json';
8687
case 'firefox': return 'manifest-firefox.json';
88+
case 'kiwi': return 'manifest-kiwi.json';
8789
case 'opera': return 'manifest-opera.json';
8890
default: return 'manifest-chrome.json';
8991
}
@@ -100,6 +102,7 @@ try {
100102
'manifest-chrome.json',
101103
'manifest-edge.json',
102104
'manifest-firefox.json',
105+
'manifest-kiwi.json',
103106
'manifest-opera.json',
104107
'manifest-puppeteer.json'
105108
// 'ui-images/**/*.*', // Exclude files in "ui-images" folder

0 commit comments

Comments
 (0)