diff options
author | 2021-10-15 09:48:06 +0200 | |
---|---|---|
committer | 2021-10-15 09:48:06 +0200 | |
commit | 14d2364fc69e0222133115c55a36286986006098 (patch) | |
tree | 9e9b3c41ef742bbe87ca1632b292c67043051957 /src/components/services/content/ServiceWebview.js | |
parent | 5.6.3-nightly.34 [skip ci] (diff) | |
download | ferdium-app-14d2364fc69e0222133115c55a36286986006098.tar.gz ferdium-app-14d2364fc69e0222133115c55a36286986006098.tar.zst ferdium-app-14d2364fc69e0222133115c55a36286986006098.zip |
chore: update eslint setup (#2074)
Diffstat (limited to 'src/components/services/content/ServiceWebview.js')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index b60ed3267..185d41175 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -24,12 +24,10 @@ class ServiceWebview extends Component { | |||
24 | super(props); | 24 | super(props); |
25 | 25 | ||
26 | reaction( | 26 | reaction( |
27 | () => ( | 27 | () => this.webview, |
28 | this.webview | ||
29 | ), | ||
30 | () => { | 28 | () => { |
31 | if (this.webview && this.webview.view) { | 29 | if (this.webview && this.webview.view) { |
32 | this.webview.view.addEventListener('console-message', (e) => { | 30 | this.webview.view.addEventListener('console-message', e => { |
33 | debug('Service logged a message:', e.message); | 31 | debug('Service logged a message:', e.message); |
34 | }); | 32 | }); |
35 | } | 33 | } |
@@ -55,20 +53,26 @@ class ServiceWebview extends Component { | |||
55 | }; | 53 | }; |
56 | 54 | ||
57 | render() { | 55 | render() { |
58 | const { | 56 | const { service, setWebviewReference, isSpellcheckerEnabled } = this.props; |
59 | service, | ||
60 | setWebviewReference, | ||
61 | isSpellcheckerEnabled, | ||
62 | } = this.props; | ||
63 | 57 | ||
64 | const preloadScript = join(__dirname, '..', '..', '..', 'webview', 'recipe.js'); | 58 | const preloadScript = join( |
59 | __dirname, | ||
60 | '..', | ||
61 | '..', | ||
62 | '..', | ||
63 | 'webview', | ||
64 | 'recipe.js', | ||
65 | ); | ||
65 | 66 | ||
66 | return ( | 67 | return ( |
67 | <ElectronWebView | 68 | <ElectronWebView |
68 | ref={(webview) => { | 69 | ref={webview => { |
69 | this.webview = webview; | 70 | this.webview = webview; |
70 | if (webview && webview.view) { | 71 | if (webview && webview.view) { |
71 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | 72 | webview.view.addEventListener( |
73 | 'did-stop-loading', | ||
74 | this.refocusWebview, | ||
75 | ); | ||
72 | } | 76 | } |
73 | }} | 77 | }} |
74 | autosize | 78 | autosize |
@@ -83,10 +87,14 @@ class ServiceWebview extends Component { | |||
83 | }} | 87 | }} |
84 | onUpdateTargetUrl={this.updateTargetUrl} | 88 | onUpdateTargetUrl={this.updateTargetUrl} |
85 | useragent={service.userAgent} | 89 | useragent={service.userAgent} |
86 | disablewebsecurity={service.recipe.disablewebsecurity ? true : undefined} | 90 | disablewebsecurity={ |
91 | service.recipe.disablewebsecurity ? true : undefined | ||
92 | } | ||
87 | allowpopups | 93 | allowpopups |
88 | nodeintegration | 94 | nodeintegration |
89 | webpreferences={`spellcheck=${isSpellcheckerEnabled ? 1 : 0}, contextIsolation=1, enableRemoteModule=1`} | 95 | webpreferences={`spellcheck=${ |
96 | isSpellcheckerEnabled ? 1 : 0 | ||
97 | }, contextIsolation=1, enableRemoteModule=1`} | ||
90 | /> | 98 | /> |
91 | ); | 99 | ); |
92 | } | 100 | } |