mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibWeb: Just ignore <script> elements that failed to load the script
We're never gonna be able to run them if we can't load them so just let it go.
This commit is contained in:
@@ -190,14 +190,19 @@ void HTMLScriptElement::prepare_script(Badge<HTMLDocumentParser>)
|
||||
// FIXME: Check classic vs. module script type
|
||||
|
||||
// FIXME: This load should be made asynchronous and the parser should spin an event loop etc.
|
||||
ResourceLoader::the().load_sync(url, [this, url](auto& data, auto&) {
|
||||
if (data.is_null()) {
|
||||
dbg() << "HTMLScriptElement: Failed to load " << url;
|
||||
return;
|
||||
}
|
||||
m_script_source = String::copy(data);
|
||||
script_became_ready();
|
||||
});
|
||||
ResourceLoader::the().load_sync(
|
||||
url,
|
||||
[this, url](auto& data, auto&) {
|
||||
if (data.is_null()) {
|
||||
dbg() << "HTMLScriptElement: Failed to load " << url;
|
||||
return;
|
||||
}
|
||||
m_script_source = String::copy(data);
|
||||
script_became_ready();
|
||||
},
|
||||
[this](auto&) {
|
||||
m_failed_to_load = true;
|
||||
});
|
||||
} else {
|
||||
// FIXME: Check classic vs. module script type
|
||||
m_script_source = source_text;
|
||||
|
||||
Reference in New Issue
Block a user