🎨 支持外跳链接

This commit is contained in:
Tw93
2022-10-23 12:42:22 +08:00
parent e1174a8710
commit 992f0c6240

View File

@@ -126,6 +126,11 @@ fn main() -> wry::Result<()> {
} }
}) })
const pakeLinks = document.links;
for (let linkIndex = 0; linkIndex < pakeLinks.length; linkIndex++) {
pakeLinks[linkIndex].target = '_self';
}
}); });
})(); })();
"#; "#;
@@ -155,7 +160,7 @@ fn main() -> wry::Result<()> {
}; };
let _webview = WebViewBuilder::new(window)? let _webview = WebViewBuilder::new(window)?
.with_url("https://weread.qq.com/")? .with_url("https://hoppscotch.io/")?
// .with_devtools(true) // .with_devtools(true)
.with_initialization_script(script) .with_initialization_script(script)
.with_ipc_handler(handler) .with_ipc_handler(handler)