mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
LibWeb: Consider resource: URLs to be trustworthy and non-opaque
This makes icons once again load in the directory listings
This commit is contained in:
parent
cb629e18bb
commit
d14888f31a
Notes:
sideshowbarker
2024-07-17 01:00:06 +09:00
Author: https://github.com/circl-lastname
Commit: d14888f31a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/129
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 4 additions and 2 deletions
|
@ -548,7 +548,8 @@ HTML::Origin url_origin(URL::URL const& url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// -> "file"
|
// -> "file"
|
||||||
if (url.scheme() == "file"sv) {
|
// AD-HOC: Our resource:// is basically an alias to file://
|
||||||
|
if (url.scheme() == "file"sv || url.scheme() == "resource"sv) {
|
||||||
// Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin.
|
// Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin.
|
||||||
// Note: We must return an origin with the `file://' protocol for `file://' iframes to work from `file://' pages.
|
// Note: We must return an origin with the `file://' protocol for `file://' iframes to work from `file://' pages.
|
||||||
return HTML::Origin(url.scheme().to_byte_string(), String {}, 0);
|
return HTML::Origin(url.scheme().to_byte_string(), String {}, 0);
|
||||||
|
|
|
@ -54,7 +54,8 @@ Trustworthiness is_origin_potentially_trustworthy(HTML::Origin const& origin)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. If origin’s scheme is "file", return "Potentially Trustworthy".
|
// 6. If origin’s scheme is "file", return "Potentially Trustworthy".
|
||||||
if (origin.scheme() == "file"sv)
|
// AD-HOC: Our resource:// is basically an alias to file://
|
||||||
|
if (origin.scheme() == "file"sv || origin.scheme() == "resource"sv)
|
||||||
return Trustworthiness::PotentiallyTrustworthy;
|
return Trustworthiness::PotentiallyTrustworthy;
|
||||||
|
|
||||||
// 7. If origin’s scheme component is one which the user agent considers to be authenticated, return "Potentially Trustworthy".
|
// 7. If origin’s scheme component is one which the user agent considers to be authenticated, return "Potentially Trustworthy".
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue