diff --git a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx index a2dd31cfab..bd360c8a30 100644 --- a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx +++ b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx @@ -1,4 +1,6 @@ import { + ArrowLeftOutlined, + ArrowRightOutlined, CloseOutlined, CodeOutlined, CopyOutlined, @@ -241,6 +243,22 @@ const MinappPopupContainer: React.FC = () => { dispatch(setMinappsOpenLinkExternal(!minappsOpenLinkExternal)) } + /** navigate back in webview history */ + const handleGoBack = (appid: string) => { + const webview = webviewRefs.current.get(appid) + if (webview && webview.canGoBack()) { + webview.goBack() + } + } + + /** navigate forward in webview history */ + const handleGoForward = (appid: string) => { + const webview = webviewRefs.current.get(appid) + if (webview && webview.canGoForward()) { + webview.goForward() + } + } + /** Title bar of the popup */ const Title = ({ appInfo, url }: { appInfo: AppInfo | null; url: string | null }) => { if (!appInfo) return null @@ -286,6 +304,16 @@ const MinappPopupContainer: React.FC = () => { )} + + + + + +