mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 00:38:28 +00:00
Only call WebViewModel.handleNavigate for main frame navigations (#1488)
Navigation events are issued not just for main page navigations, but also for iframes, among other things. With our old behavior, if an iframe tries to load in a webpage, we would update the webview url and make the iframe the primary page, which is wrong. Now, we only do this for main frame navigations. closes #1487
This commit is contained in:
parent
ed17c76ada
commit
6684a5c2b8
1 changed files with 5 additions and 2 deletions
|
|
@ -532,8 +532,11 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => {
|
|||
return;
|
||||
}
|
||||
const navigateListener = (e: any) => {
|
||||
setErrorText("");
|
||||
model.handleNavigate(e.url);
|
||||
console.log("webview did-navigate event:", e);
|
||||
if (e.isMainFrame) {
|
||||
setErrorText("");
|
||||
model.handleNavigate(e.url);
|
||||
}
|
||||
};
|
||||
const newWindowHandler = (e: any) => {
|
||||
e.preventDefault();
|
||||
|
|
|
|||
Loading…
Reference in a new issue