diff --git a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp index 65e2ce93a9f..15170c15f52 100644 --- a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -548,7 +548,8 @@ HTML::Origin url_origin(URL::URL const& url) } // -> "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. // 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); diff --git a/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp b/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp index 03621c828c4..04560ff5ba0 100644 --- a/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp @@ -54,7 +54,8 @@ Trustworthiness is_origin_potentially_trustworthy(HTML::Origin const& origin) } // 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; // 7. If origin’s scheme component is one which the user agent considers to be authenticated, return "Potentially Trustworthy".