mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb/HTML: Set a fetch client for javascript URL navigations
There is an open spec issue for this, and I'm certainly not sure what the client should be here, but using the source snapshot from the global from reading the spec issue seems like a reasonable enough client for now. This can be reproduced by performing a javascript URL navigation with any CSP policy set. For simplicity, simply edit an existing testcase to add such a policy. Fixes: #4853
This commit is contained in:
parent
e364443e60
commit
cdb249e058
|
|
@ -1931,6 +1931,9 @@ void Navigable::navigate_to_a_javascript_url(URL::URL const& url, HistoryHandlin
|
|||
request->set_url(url);
|
||||
request->set_policy_container(source_snapshot_params->source_policy_container);
|
||||
|
||||
// AD-HOC: See https://github.com/whatwg/html/issues/4651, requires some investigation to figure out what we should be setting here.
|
||||
request->set_client(source_snapshot_params->fetch_client);
|
||||
|
||||
// 5. If the result of should navigation request of type be blocked by Content Security Policy? given request and cspNavigationType is "Blocked", then return.
|
||||
if (ContentSecurityPolicy::should_navigation_request_of_type_be_blocked_by_content_security_policy(request, csp_navigation_type) == ContentSecurityPolicy::Directives::Directive::Result::Blocked)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src javascript:;">
|
||||
</head>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user