Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSP] Modify existing content security policy not work #1845

Closed
freemedom opened this issue Sep 3, 2023 · 5 comments
Closed

[CSP] Modify existing content security policy not work #1845

freemedom opened this issue Sep 3, 2023 · 5 comments

Comments

@freemedom
Copy link

freemedom commented Sep 3, 2023

(Please fill out the issue template with your details)

Expected Behavior

Modify existing content security policy (CSP) headers: Remove entirely (possibly unsecure)

Actual Behavior

not work, cannot remove csp headers
still show "Refused to load the script 'https://esm.sh/octokit' because it violates the following Content Security Policy directive"
Seems to have a version before is valid. I remember when I first wrote this script (a month ago) it worked.

Specifications

  • Chromium: (114.0.5735.199)
  • TM: (v4.20.6185) beta
  • OS: (windows10)

Script

(Please give an example of the script if applicable.)

	const { Octokit, App } = await import("https://esm.sh/octokit");
@freemedom
Copy link
Author

now i use https://chrome.google.com/webstore/detail/disable-content-security/ieelmcmcagommplceebfedjlakkhpden
but it must manually click and refresh

@derjanb
Copy link
Member

derjanb commented Sep 20, 2023

If it worked earlier you can switch "Modify existing content security policy (CSP) headers" from "Auto" to "Yes". This will restore the old behavior. However, Tampermonkey can't support CSP relaxing in Chrome when manifest v3 becomes mandatory and also won't support CSP relaxing in Firefox in the near future.

@derjanb derjanb closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@freemedom
Copy link
Author

I switched to "yes", but it still didn't work.
image

@freemedom
Copy link
Author

@derjanb

@derjanb
Copy link
Member

derjanb commented Sep 21, 2023

Then is never worked with a strict page CSP. You have to set the option to "Remove" (which is working fine here) or better use a bundler like webpack to include all sources in one script, or use @require

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants