diff options
author | 2019-10-09 09:48:41 +0200 | |
---|---|---|
committer | 2019-10-09 09:48:41 +0200 | |
commit | da9e8a3d5b11efcc8eeee325c0ac7eb7840f75af (patch) | |
tree | a189f4566c6380b86aeb04b9307aea23fc6e14d7 /src/components/services/content/ServiceWebview.js | |
parent | Update zh-HANT.json (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-da9e8a3d5b11efcc8eeee325c0ac7eb7840f75af.tar.gz ferdium-app-da9e8a3d5b11efcc8eeee325c0ac7eb7840f75af.tar.zst ferdium-app-da9e8a3d5b11efcc8eeee325c0ac7eb7840f75af.zip |
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.4.0
Diffstat (limited to 'src/components/services/content/ServiceWebview.js')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 03d6d5bcc..e6ebb6afb 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -38,6 +38,13 @@ class ServiceWebview extends Component { | |||
38 | detachService({ service }); | 38 | detachService({ service }); |
39 | } | 39 | } |
40 | 40 | ||
41 | refocusWebview = () => { | ||
42 | const { webview } = this; | ||
43 | if (!webview) return; | ||
44 | webview.view.blur(); | ||
45 | webview.view.focus(); | ||
46 | }; | ||
47 | |||
41 | render() { | 48 | render() { |
42 | const { | 49 | const { |
43 | service, | 50 | service, |
@@ -46,7 +53,12 @@ class ServiceWebview extends Component { | |||
46 | 53 | ||
47 | return ( | 54 | return ( |
48 | <ElectronWebView | 55 | <ElectronWebView |
49 | ref={(webview) => { this.webview = webview; }} | 56 | ref={(webview) => { |
57 | this.webview = webview; | ||
58 | if (webview && webview.view) { | ||
59 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | ||
60 | } | ||
61 | }} | ||
50 | autosize | 62 | autosize |
51 | src={service.url} | 63 | src={service.url} |
52 | preload="./webview/recipe.js" | 64 | preload="./webview/recipe.js" |