mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibWeb: Make default document readiness be "complete"
This is required by mini Cloudflare invisible challenges, as it will only run if the readyState is not "loading". If it is "loading", then it waits for readystatechange to check that it's not "loading" anymore. Initial about:blank iframes do not go through the full navigation and thus don't go through HTMLParser::the_end, which sets the ready state to something other than "loading". Therefore, the challenge would never run, as readyState would never change. Seen on https://discord.com/login
This commit is contained in:
parent
4203b7823f
commit
f638f84185
Notes:
github-actions[bot]
2024-11-20 15:24:30 +00:00
Author: https://github.com/Lubrsi
Commit: f638f84185
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2363
4 changed files with 28 additions and 13 deletions
|
@ -127,21 +127,11 @@
|
|||
globalThis.doneCallback = done;
|
||||
|
||||
const blobIframeLoadPromise = new Promise(resolve => {
|
||||
if (blobIframe.contentDocument.readyState === "complete") {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
blobIframe.onload = () => resolve();
|
||||
}
|
||||
blobIframe.onload = () => resolve();
|
||||
});
|
||||
|
||||
const srcdocIframeLoadPromise = new Promise(resolve => {
|
||||
if (iframe.contentDocument.readyState === "complete") {
|
||||
resolve()
|
||||
}
|
||||
else {
|
||||
iframe.onload = () => resolve();
|
||||
}
|
||||
iframe.onload = () => resolve();
|
||||
});
|
||||
|
||||
Promise.all([blobIframeLoadPromise, srcdocIframeLoadPromise]).then(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue