Skip to content

Commit

Permalink
fix chrome and firefox build
Browse files Browse the repository at this point in the history
  • Loading branch information
dufoli committed May 29, 2024
1 parent 74051ec commit 18352e0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
40 changes: 26 additions & 14 deletions addon/manifest-template.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
{
"name": "Salesforce Inspector Advanced",
"description": "Productivity tools for Salesforce administrators and developers to inspect data and metadata directly from the Salesforce UI.",
"version": "1.27.1",
"version": "1.27",
"version_name": "1.27",
"icons": {
"128": "icon128.png"
},
"minimum_chrome_version": "88",
"applications": {
"gecko": {
"id": "salesforceinspector@advanced",
"strict_min_version": "60.0"
}
},
"permissions": [
"cookies"
],
"host_permissions": [
"https://*.salesforce.com/*",
"https://*.force.com/*",
"https://*.cloudforce.com/*",
Expand All @@ -24,8 +29,7 @@
"https://*.visualforce.mil/*",
"https://*.crmforce.mil/*",
"https://*.force.com.mcas.ms/*",
"https://*.salesforce-setup.com/*",
"cookies"
"https://*.salesforce-setup.com/*"
],
"content_scripts": [
{
Expand Down Expand Up @@ -65,17 +69,25 @@
]
},
"web_accessible_resources": [
"popup.html",
"apex-runner.html",
"log.html",
"streaming.html",
"data-export.html",
"data-import.html",
"inspect.html",
"metadata-retrieve.html",
"explore-api.html",
"limits.html",
"options.html"
{
"resources": [
"popup.html",
"apex-runner.html",
"log.html",
"streaming.html",
"data-export.html",
"data-import.html",
"inspect.html",
"metadata-retrieve.html",
"explore-api.html",
"limits.html",
"options.html"
],
"matches": [
"https://*/*"
],
"extension_ids": []
}
],
"incognito": "spanning",
"manifest_version": 2
Expand Down
9 changes: 8 additions & 1 deletion scripts/dev-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ if (browser == "firefox") {
// Firefox needs to run in spanning mode, since it does not support split mode.
manifest.incognito = "spanning";

manifest.permissions = manifest.permissions.concat(manifest["host_permissions"]);
manifest["web_accessible_resources"] = manifest["web_accessible_resources"][0].resources;
delete manifest["host_permissions"];
// Remove unused property, for consistency with the Chrome version.
delete manifest.minimum_chrome_version;
delete manifest["version_name"];

} else if (browser == "chrome") {

// Chrome needs to run in split mode, since it does not support opening private extension tabs in spanning mode.
manifest.incognito = "split";

manifest.background["service_worker"] = manifest.background.scripts[0];
delete manifest.background.scripts;
manifest.background.type = "module";
manifest["manifest_version"] = 3;
// Remove irrelevant but annoying warning message "Unrecognized manifest key 'applications'.".
delete manifest.applications;

Expand Down

0 comments on commit 18352e0

Please sign in to comment.