mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +00:00
LibWeb: Set LinkProcessingOptions' cryptographic_nonce_metadata
Fixes external CSS being blocked on https://beatsaver.com/, where they have a `style-src` directive set to `'self' 'nonce-[value]'` Relates to #5643, but does not make the website load.
This commit is contained in:
parent
1d57df6e26
commit
59162342e6
Notes:
github-actions[bot]
2025-08-07 17:29:14 +00:00
Author: https://github.com/Lubrsi
Commit: 59162342e6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5726
3 changed files with 14 additions and 1 deletions
|
@ -265,6 +265,8 @@ HTMLLinkElement::LinkProcessingOptions HTMLLinkElement::create_link_options()
|
|||
// 2. Let options be a new link processing options with
|
||||
LinkProcessingOptions options {
|
||||
// FIXME: destination the result of translating the state of el's as attribute
|
||||
// cryptographic nonce metadata the current value of el's [[CryptographicNonce]] internal slot
|
||||
.cryptographic_nonce_metadata = m_cryptographic_nonce,
|
||||
// crossorigin the state of el's crossorigin content attribute
|
||||
.crossorigin = cors_setting_attribute_from_keyword(get_attribute(AttributeNames::crossorigin)),
|
||||
// referrer policy the state of el's referrerpolicy content attribute
|
||||
|
@ -280,7 +282,6 @@ HTMLLinkElement::LinkProcessingOptions HTMLLinkElement::create_link_options()
|
|||
.policy_container = document.policy_container(),
|
||||
// document document
|
||||
.document = &document,
|
||||
// FIXME: cryptographic nonce metadata the current value of el's [[CryptographicNonce]] internal slot
|
||||
// fetch priority the state of el's fetchpriority content attribute
|
||||
.fetch_priority = Fetch::Infrastructure::request_priority_from_string(get_attribute_value(HTML::AttributeNames::fetchpriority)).value_or(Fetch::Infrastructure::Request::Priority::Auto),
|
||||
};
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
rgb(255, 0, 0)
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Security-Policy" content="style-src 'nonce-value';">
|
||||
<link rel="stylesheet" href="../body-background-color-red.css" nonce="value">
|
||||
</head>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println(window.getComputedStyle(document.body).backgroundColor);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue