mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Set filename of module scripts to full URL instead of basename
Atlassian login gets the base URL for its module scripts by throwing an error and pulling out the current script's URL from error.stack with regex. Since we only returned a basename for module scripts, it would fail to match and try and use `/` as a base URL (because it does [matched_string] + "/"), which is not a valid base URL.
This commit is contained in:
committed by
Andreas Kling
parent
22448b0c35
commit
847589404b
Notes:
github-actions[bot]
2025-08-26 13:47:47 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/847589404bb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5678
@@ -713,7 +713,7 @@ void fetch_single_module_script(JS::Realm& realm,
|
||||
// 7. If mimeType is a JavaScript MIME type and moduleType is "javascript", then set moduleScript to the result of creating a JavaScript module script given sourceText, moduleMapRealm, response's URL, and options.
|
||||
// FIXME: Pass options.
|
||||
if (mime_type.has_value() && mime_type->is_javascript() && module_type == "javascript")
|
||||
module_script = JavaScriptModuleScript::create(url.basename(), source_text, module_map_realm, response->url().value_or({})).release_value_but_fixme_should_propagate_errors();
|
||||
module_script = JavaScriptModuleScript::create(url.to_byte_string(), source_text, module_map_realm, response->url().value_or({})).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// FIXME: 8. If the MIME type essence of mimeType is "text/css" and moduleType is "css", then set moduleScript to the result of creating a CSS module script given sourceText and settingsObject.
|
||||
// FIXME: 9. If mimeType is a JSON MIME type and moduleType is "json", then set moduleScript to the result of creating a JSON module script given sourceText and settingsObject.
|
||||
|
||||
Reference in New Issue
Block a user