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

[BUG] CSP restricted inline-style in Overlay CSUI. #979

Open
2 of 3 tasks
kuloud opened this issue May 18, 2024 · 0 comments
Open
2 of 3 tasks

[BUG] CSP restricted inline-style in Overlay CSUI. #979

kuloud opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kuloud
Copy link

kuloud commented May 18, 2024

What happened?

The CSP restricted inline-style is configured on some web pages, causing injectAnchor to be executed abnormally on the csui.ts, and the CSUI style does not take effect:

import cssText from "data-text:~style.css"
export function getStyle() {
  const style = document.createElement("style")
  style.textContent = cssText
  return style
}

image

https://developer.apple.com/documentation/safariservices/safari_web_extensions/style.css

guide.6d2501fe.js:72 Refused to connect to 'ws://localhost:1815/' because it violates the following Content Security Policy directive: "default-src 'self' *.apple.com". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' *.apple.com 'sha256-8sYhey1EBDQi8bgEKVzQaukvyoXk2XyF4mAm3oRZ/SQ='". Either the 'unsafe-inline' keyword, a hash ('sha256-wziXN3zGg/m2EZsVU1JeuUbR22M36/vyuqwFduwiJC4='), or a nonce ('nonce-...') is required to enable inline execution.

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@kuloud kuloud added the bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant