mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Get Page from principal realm during resource loading
Fixes a crash for module loading for a shadow realm.
This commit is contained in:
parent
b677844f8d
commit
4913dac745
|
|
@ -2240,7 +2240,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> nonstandard_resource_loader_file_o
|
||||||
|
|
||||||
auto request = fetch_params.request();
|
auto request = fetch_params.request();
|
||||||
|
|
||||||
auto& page = Bindings::principal_host_defined_page(realm);
|
auto& page = Bindings::principal_host_defined_page(HTML::principal_realm(realm));
|
||||||
|
|
||||||
// NOTE: Using LoadRequest::create_for_url_on_page here will unconditionally add cookies as long as there's a page available.
|
// NOTE: Using LoadRequest::create_for_url_on_page here will unconditionally add cookies as long as there's a page available.
|
||||||
// However, it is up to http_network_or_cache_fetch to determine if cookies should be added to the request.
|
// However, it is up to http_network_or_cache_fetch to determine if cookies should be added to the request.
|
||||||
|
|
|
||||||
1
Tests/LibWeb/Text/data/external-module.mjs
Normal file
1
Tests/LibWeb/Text/data/external-module.mjs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export const foo = "Well hello shadows";
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Well hello shadows
|
||||||
10
Tests/LibWeb/Text/input/HTML/ShadowRealm-importValue.html
Normal file
10
Tests/LibWeb/Text/input/HTML/ShadowRealm-importValue.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
asyncTest(async done => {
|
||||||
|
const shadowRealm = new ShadowRealm();
|
||||||
|
const promise = shadowRealm.importValue("../../data/external-module.mjs", "foo");
|
||||||
|
const value = await promise;
|
||||||
|
println(value);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user