diff options
author | Chandrika Priya Bogadi <46720139+Chandrika-Priya@users.noreply.github.com> | 2021-10-26 23:03:36 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 23:03:36 +0530 |
commit | 1801f98f8e2ca28619608b29bcf623581fa76747 (patch) | |
tree | d2653b410c07e3e5cac5e4bc2465d892e2a8fa9d /src/components | |
parent | docs: add Chandrika-Priya as a contributor for code (#2145) [skip ci] (diff) | |
download | ferdium-app-1801f98f8e2ca28619608b29bcf623581fa76747.tar.gz ferdium-app-1801f98f8e2ca28619608b29bcf623581fa76747.tar.zst ferdium-app-1801f98f8e2ca28619608b29bcf623581fa76747.zip |
Add feature to display document title along with current title (#2143)
Co-authored by: Rachel Cynthia <rachel883omega@gmail.com>
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 185d41175..2562c09ce 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -30,9 +30,14 @@ class ServiceWebview extends Component { | |||
30 | this.webview.view.addEventListener('console-message', e => { | 30 | this.webview.view.addEventListener('console-message', e => { |
31 | debug('Service logged a message:', e.message); | 31 | debug('Service logged a message:', e.message); |
32 | }); | 32 | }); |
33 | this.webview.view.addEventListener('did-navigate', () => { | ||
34 | document.title = `Ferdi - ${this.props.service.name} ${this.props.service.dialogTitle | ||
35 | ? ` - ${this.props.service.dialogTitle}` | ||
36 | : '' | ||
37 | } ${`- ${this.props.service._webview.getTitle()}`}`; | ||
38 | }) | ||
33 | } | 39 | } |
34 | }, | 40 | }) |
35 | ); | ||
36 | } | 41 | } |
37 | 42 | ||
38 | componentWillUnmount() { | 43 | componentWillUnmount() { |
@@ -47,6 +52,12 @@ class ServiceWebview extends Component { | |||
47 | if (this.props.service.isActive) { | 52 | if (this.props.service.isActive) { |
48 | webview.view.blur(); | 53 | webview.view.blur(); |
49 | webview.view.focus(); | 54 | webview.view.focus(); |
55 | window.setTimeout(() => { | ||
56 | document.title = `Ferdi - ${this.props.service.name} ${this.props.service.dialogTitle | ||
57 | ? ` - ${this.props.service.dialogTitle}` | ||
58 | : '' | ||
59 | } ${`- ${this.props.service._webview.getTitle()}`}`; | ||
60 | }, 100); | ||
50 | } else { | 61 | } else { |
51 | debug('Refocus not required - Not active service'); | 62 | debug('Refocus not required - Not active service'); |
52 | } | 63 | } |
@@ -92,9 +103,8 @@ class ServiceWebview extends Component { | |||
92 | } | 103 | } |
93 | allowpopups | 104 | allowpopups |
94 | nodeintegration | 105 | nodeintegration |
95 | webpreferences={`spellcheck=${ | 106 | webpreferences={`spellcheck=${isSpellcheckerEnabled ? 1 : 0 |
96 | isSpellcheckerEnabled ? 1 : 0 | 107 | }, contextIsolation=1, enableRemoteModule=1`} |
97 | }, contextIsolation=1, enableRemoteModule=1`} | ||
98 | /> | 108 | /> |
99 | ); | 109 | ); |
100 | } | 110 | } |