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

Additional CSS doesn't work on kernel.org #55

Open
snshn opened this issue Nov 11, 2021 · 1 comment
Open

Additional CSS doesn't work on kernel.org #55

snshn opened this issue Nov 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@snshn
Copy link
Member

snshn commented Nov 11, 2021

Error message:

js: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-37Qv0ESIAHC7q5kW3AjdcNW/glH9Aix+J0H5hiCl7VM='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

@snshn snshn added the bug Something isn't working label Nov 11, 2021
@snshn
Copy link
Member Author

snshn commented Nov 27, 2021

Possible solution:

static const QString js = "'undefined' != typeof document.styleSheets && 0 < document.styleSheets.length && document.styleSheets[0].addRule('::-webkit-scrollbar', 'width: 0 !important; height: 0 !important', 0);";

page()->runJavaScript(QString(js), QWebEngineScript::ApplicationWorld);

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