Skip to content

Commit

Permalink
hotfix: remove hmr host from csp
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgv committed Sep 5, 2023
1 parent 83f30db commit d975d46
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/create-plasmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-plasmo",
"version": "0.82.2",
"version": "0.82.3",
"description": "Create Plasmo Framework Browser Extension",
"main": "dist/index.js",
"bin": "bin/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plasmo",
"version": "0.82.2",
"version": "0.82.3",
"description": "The Plasmo Framework CLI",
"publishConfig": {
"types": "dist/type.d.ts"
Expand Down
2 changes: 1 addition & 1 deletion core/parcel-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-config",
"version": "0.39.2",
"version": "0.39.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion core/parcel-transformer-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-transformer-manifest",
"version": "0.17.7",
"version": "0.17.8",
"description": "Plasmo Parcel Transformer for Web Extension Manifest",
"files": [
"dist",
Expand Down
7 changes: 2 additions & 5 deletions core/parcel-transformer-manifest/src/handle-background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,11 @@ function handleMV2HotCsp(program: MV2Data) {

// Enable eval HMR for sandbox,
function handleMV3HotCsp(program: MV3Data) {
const { hot, hmrOptions } = getState()
const { hot } = getState()

if (hot) {
const csp = program.content_security_policy || {}
csp.extension_pages = cspPatchHMR(
csp.extension_pages,
`http://${hmrOptions?.host || "localhost"}`
)
csp.extension_pages = cspPatchHMR(csp.extension_pages, `http://localhost`)
// Sandbox allows eval by default
if (csp.sandbox) {
csp.sandbox = cspPatchHMR(csp.sandbox)
Expand Down

0 comments on commit d975d46

Please sign in to comment.