diff --git a/app/main/utils/window/search.js b/app/main/utils/window/search.js index b65c1b15..6a94da30 100644 --- a/app/main/utils/window/search.js +++ b/app/main/utils/window/search.js @@ -26,7 +26,9 @@ export function hideSearch() { * windowOS need to `search.window.blur()` to hide menubar. * macOS need to `search.hideWindow()`. */ - search.window.blur(); // Need to reopen in windowOS + if (search.window) { + search.window.blur(); // Need to reopen in windowOS + } search.hideWindow(); // Need to reopen in macOS } diff --git a/app/renderer/pages/widget/components/WebWidget/index.jsx b/app/renderer/pages/widget/components/WebWidget/index.jsx index 88f0f472..7d6c46a9 100644 --- a/app/renderer/pages/widget/components/WebWidget/index.jsx +++ b/app/renderer/pages/widget/components/WebWidget/index.jsx @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { Helmet } from 'react-helmet'; import * as NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import url from 'url'; @@ -36,6 +37,7 @@ const initialPage = 'https://google.com'; class WebWidget extends React.Component { state = { + title: '', currentUrl: '', isLoading: false, isSettingOpen: false, @@ -99,6 +101,10 @@ class WebWidget extends React.Component { NProgress.done(); this.setState({ isLoading: false }); }); + + webView.addEventListener('page-title-updated', ({ title }) => { + this.setState({ title }); + }); }; configureNavigateEvent = () => { @@ -197,6 +203,7 @@ class WebWidget extends React.Component { const text = i18n().widget; const { currentUrl, + title, isLoading, isMakeMenuOpen, newWindowURL, @@ -211,6 +218,9 @@ class WebWidget extends React.Component { return (