generated from NekitCorp/chrome-extension-svelte-typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extremely stupid hack with per-tab panels
- Loading branch information
Showing
9 changed files
with
101 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
console.log('Removing side_panel from manifest, be ready...') | ||
|
||
import manifest from '../dist/manifest.json' assert { type: "json" }; | ||
import fs from 'fs/promises' | ||
|
||
const newManifest = {...manifest} | ||
delete newManifest.side_panel | ||
|
||
fs.writeFile('./dist/manifest.json', JSON.stringify(newManifest, null, 2)) | ||
|
||
console.log('side_panel eliminated') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { defineManifest } from "@crxjs/vite-plugin"; | ||
import packageJson from "../package.json"; | ||
|
||
const { version, name, description } = packageJson; | ||
|
||
// Convert from Semver (example: 0.1.0-beta6) | ||
const [major, minor, patch] = version | ||
// can only contain digits, dots, or dash | ||
.replace(/[^\d.-]+/g, "") | ||
// split into version parts | ||
.split(/[.-]/); | ||
|
||
export default defineManifest(async (env) => ({ | ||
manifest_version: 3, | ||
name: name, | ||
description: description, | ||
version: `${major}.${minor}.${patch}`, | ||
version_name: version, | ||
icons: { | ||
"16": "src/assets/icons/icon-16.png", | ||
"32": "src/assets/icons/icon-32.png", | ||
"48": "src/assets/icons/icon-48.png", | ||
"128": "src/assets/icons/icon-128.png", | ||
}, | ||
background: { | ||
service_worker: "src/background/index.ts", | ||
}, | ||
options_ui: { | ||
page: "src/options/options.html", | ||
open_in_tab: false, | ||
}, | ||
// This has to be removed due to that stupid sidepanel bug | ||
// side_panel: { | ||
// default_path: "src/sidepanel/sidepanel.html", | ||
// }, | ||
action: { | ||
default_icon: { | ||
"16": "src/assets/icons/icon-16.png", | ||
"32": "src/assets/icons/icon-32.png", | ||
"48": "src/assets/icons/icon-48.png", | ||
"128": "src/assets/icons/icon-128.png", | ||
}, | ||
}, | ||
host_permissions: ["<all_urls>"], | ||
permissions: ["storage", "sidePanel", "activeTab","scripting"] as chrome.runtime.ManifestPermissions[], | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters