@@ -7,22 +7,22 @@ import { getSimpleControlShiftAtom } from "@/app/store/keymodel";
77import type { TabModel } from "@/app/store/tab-model" ;
88import { makeORef } from "@/app/store/wos" ;
99import { TabRpcClient } from "@/app/store/wshrpcutil" ;
10- import { useWaveEnv } from "@/app/waveenv/waveenv" ;
1110import {
1211 BlockHeaderSuggestionControl ,
1312 SuggestionControlNoData ,
1413 SuggestionControlNoResults ,
1514} from "@/app/suggestion/suggestion" ;
1615import { MockBoundary } from "@/app/waveenv/mockboundary" ;
17- import { globalStore } from "@/store/global" ;
16+ import { useWaveEnv } from "@/app/waveenv/waveenv" ;
17+ import { globalStore , openLink } from "@/store/global" ;
1818import { adaptFromReactOrNativeKeyEvent , checkKeyPressed } from "@/util/keyutil" ;
1919import { fireAndForget , useAtomValueSafe } from "@/util/util" ;
2020import clsx from "clsx" ;
2121import { WebviewTag } from "electron" ;
2222import { Atom , PrimitiveAtom , atom , useAtomValue , useSetAtom } from "jotai" ;
2323import { Fragment , createRef , memo , useCallback , useEffect , useRef , useState } from "react" ;
24- import type { WebViewEnv } from "./webviewenv" ;
2524import "./webview.scss" ;
25+ import type { WebViewEnv } from "./webviewenv" ;
2626
2727// User agent strings for mobile emulation
2828const USER_AGENT_IPHONE =
@@ -1010,14 +1010,7 @@ const WebView = memo(({ model, onFailLoad, blockRef, initialSrc }: WebViewProps)
10101010 const newWindowHandler = ( e : any ) => {
10111011 e . preventDefault ( ) ;
10121012 const newUrl = e . detail . url ;
1013- fireAndForget ( ( ) =>
1014- env . createBlock ( {
1015- meta : {
1016- view : "web" ,
1017- url : newUrl ,
1018- } ,
1019- } )
1020- ) ;
1013+ fireAndForget ( ( ) => openLink ( newUrl , true ) ) ;
10211014 } ;
10221015 const startLoadingHandler = ( ) => {
10231016 model . setRefreshIcon ( "xmark-large" ) ;
@@ -1120,4 +1113,4 @@ const WebView = memo(({ model, onFailLoad, blockRef, initialSrc }: WebViewProps)
11201113 ) ;
11211114} ) ;
11221115
1123- export { getWebPreviewDisplayUrl , WebView , WebViewPreviewFallback } ;
1116+ export { WebView , WebViewPreviewFallback , getWebPreviewDisplayUrl } ;
0 commit comments