Skip to content

Commit

Permalink
Fixed vite CORS policy blocks script access in development
Browse files Browse the repository at this point in the history
  • Loading branch information
biplobsd committed Jan 23, 2025
1 parent 144a95f commit db8efba
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 96 deletions.
188 changes: 94 additions & 94 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/manifest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const [major, minor, patch] = version
// split into version parts
.split(/[.-]/);

const isDev = process.env.NODE_ENV === "development";

export default defineManifest({
manifest_version: 3,
name: "Youtube Subscriptions Transfer",
Expand All @@ -33,7 +35,7 @@ export default defineManifest({
],
background: {
service_worker: "src/background/index.ts",
scripts: ["src/background/index.ts"]
scripts: ["src/background/index.ts"],
},
options_ui: {
page: "src/options/options.html",
Expand All @@ -53,4 +55,9 @@ export default defineManifest({
"identity",
"storage",
] as chrome.runtime.ManifestPermissions[],
...(isDev
? {
host_permissions: ["<all_urls"],
}
{}),
});
Loading

0 comments on commit db8efba

Please sign in to comment.