Skip to content

Commit

Permalink
separating manifest for chrome and firefox extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
uggrock committed Apr 30, 2024
1 parent 31752fd commit ef29e2c
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 88 deletions.
53 changes: 0 additions & 53 deletions src/manifest-v3.json

This file was deleted.

31 changes: 14 additions & 17 deletions src/manifest.chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@
"name": "__MSG_appName__",
"short_name": "TagSpaces",
"version": "0.0.0.0",
"version_name": "0.0.0.0",
"manifest_version": 2,
"manifest_version": 3,
"homepage_url": "https://www.tagspaces.org",
"description": "__MSG_appDesc__",
"permissions": [
"<all_urls>",
"pageCapture",
"tabs",
"downloads",
"activeTab",
"storage"
"storage",
"scripting"
],
"content_security_policy": {},
"default_locale": "en_US",
"browser_action": {
"action": {
"default_icon": "images/icon-128.png",
"default_title": "__MSG_appLauncher__",
"default_popup": "popup.html",
"browser_style": true
"default_popup": "popup.html"
},
"icons": {
"16": "images/icon-16.png",
"48": "images/icon-48.png",
"128": "images/icon-128.png"
},
"host_permissions": ["http://*/", "https://*/", "<all_urls>"],
"background": {
"scripts": ["vendor/browser-polyfill.js", "background.dist.js"],
"persistent": false
"service_worker": "service-worker.dist.js"
},
"commands": {
"_execute_browser_action": {
"description": "Save page",
"_execute_action": {
"suggested_key": {
"windows": "Ctrl+Shift+S",
"mac": "Command+Shift+S",
"chromeos": "Ctrl+Shift+S",
"linux": "Ctrl+Shift+S"
"default": "Ctrl+Shift+S",
"mac": "Command+Shift+S"
}
}
},
"options_ui": {
"page": "options.html"
},
"homepage_url": "https://www.tagspaces.org"
}
}
31 changes: 21 additions & 10 deletions src/manifest.firefox.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
{
"name": "__MSG_appName__",
"short_name": "TagSpaces",
"version": "0.0.0.0",
"manifest_version": 2,
"manifest_version": 3,
"homepage_url": "https://www.tagspaces.org",
"description": "__MSG_appDesc__",
"permissions": [
"<all_urls>",
"pageCapture",
"tabs",
"downloads",
"contextMenus",
"activeTab",
"storage"
"storage",
"scripting"
],
"content_security_policy": {},
"default_locale": "en_US",
"browser_action": {
"action": {
"default_icon": "images/icon-128.png",
"default_title": "__MSG_appLauncher__",
"default_popup": "popup.html",
"browser_style": true
"default_popup": "popup.html"
},
"icons": {
"16": "images/icon-16.png",
"48": "images/icon-48.png",
"128": "images/icon-128.png"
},
"host_permissions": ["http://*/", "https://*/", "<all_urls>"],
"background": {
"scripts": ["background.dist.js"]
"scripts": ["service-worker.dist.js"]
},
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+S",
"mac": "Command+Shift+S"
}
}
},
"options_ui": {
"page": "options.html"
},
"applications": {
"browser_specific_settings": {
"gecko": {
"id": "jid1-FBaMKxTifTSahQ@jetpack"
}
},
"homepage_url": "https://www.tagspaces.org"
}
}
1 change: 0 additions & 1 deletion src/static/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
</label>
</div>
<script src="./vendor/FileSaver.min.js" type="text/javascript"></script>
<script src="./vendor/purify.min.js" type="text/javascript"></script>
<script src="./vendor/openlocationcode.js" type="text/javascript"></script>
<script src="./popup.dist.js" type="text/javascript"></script>
</body>
Expand Down
11 changes: 5 additions & 6 deletions utils/patch-version.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const sh = require('shelljs');
const packageJSON = require('../package.json');
const sh = require("shelljs");
const packageJSON = require("../package.json");
const currentVersion = packageJSON.version;
// const path = require('path');

console.log('Patching with version: ' + currentVersion);
console.log("Patching with version: " + currentVersion);

// sh.cd('build/chrome')
sh.sed('-i', '0.0.0.0', currentVersion, 'build/chrome/manifest.json');
sh.sed('-i', '0.0.0.0', currentVersion, 'build/firefox/manifest.json');

sh.sed("-i", "0.0.0.0", currentVersion, "build/chrome/manifest.json");
sh.sed("-i", "0.0.0.0", currentVersion, "build/firefox/manifest.json");
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ let config = {
{ from: "./static/", to: "./" },
{ from: "../LICENSE", to: "./" },
{ from: "../_locales/", to: "./_locales" },
{ from: `./manifest-v3.json`, to: `./manifest.json` },
{
from: `./manifest.${process.env.TARGET}.json`,
to: `./manifest.json`,
},
{ from: "../src/lib/openlocationcode.js", to: "./vendor/" },
{
from: "../node_modules/open-location-code/LICENSE",
Expand Down

0 comments on commit ef29e2c

Please sign in to comment.