Support isSecureContext for custom protocols

Signed-off-by: Tony <legendmastertony@gmail.com>
This commit is contained in:
Tony 2025-04-25 22:01:08 +08:00
parent 894fbd003d
commit d49689bf09
No known key found for this signature in database
GPG key ID: 34BDD3EA27824956
13 changed files with 103 additions and 10 deletions

View file

@ -110,6 +110,10 @@ impl ProtocolRegistry {
self.handlers.get(scheme).map(|e| e.as_ref())
}
pub fn iter(&self) -> std::collections::hash_map::Iter<'_, String, Box<dyn ProtocolHandler>> {
self.handlers.iter()
}
pub fn merge(&mut self, mut other: ProtocolRegistry) {
for (scheme, handler) in other.handlers.drain() {
if FORBIDDEN_SCHEMES.contains(&scheme.as_str()) {