add asynchronous custom protocol support (#2535)

Added asynchronous custom protocol handling
This commit is contained in:
Huddy Buddy authored and GitHub committed 2024-06-18 15:53:39 -07:00
1 parent 07e67991cc
commit 5e3bb4f549
2 files changed
+49 -2

No files matched your search

+4
View File
@@ -169,6 +169,10 @@ impl WebviewInstance {
webview = webview.with_custom_protocol(name, handler);
}
for (name, handler) in cfg.asynchronous_protocols.drain(..) {
webview = webview.with_asynchronous_custom_protocol(name, handler);
}
const INITIALIZATION_SCRIPT: &str = r#"
if (document.addEventListener) {
document.addEventListener('contextmenu', function(e) {