diff options
Diffstat (limited to 'src/components/services/content/ServiceWebview.js')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index f1c4251ba..6d6089793 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -7,8 +7,7 @@ import { join } from 'path'; | |||
7 | 7 | ||
8 | import ServiceModel from '../../../models/Service'; | 8 | import ServiceModel from '../../../models/Service'; |
9 | 9 | ||
10 | // TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed | 10 | const debug = require('../../../preload-safe-debug')('Ferdium:Services'); |
11 | // const debug = require('debug')('Ferdium:Services'); | ||
12 | 11 | ||
13 | class ServiceWebview extends Component { | 12 | class ServiceWebview extends Component { |
14 | static propTypes = { | 13 | static propTypes = { |
@@ -28,7 +27,7 @@ class ServiceWebview extends Component { | |||
28 | () => { | 27 | () => { |
29 | if (this.webview && this.webview.view) { | 28 | if (this.webview && this.webview.view) { |
30 | this.webview.view.addEventListener('console-message', e => { | 29 | this.webview.view.addEventListener('console-message', e => { |
31 | console.log('Service logged a message:', e.message); | 30 | debug('Service logged a message:', e.message); |
32 | }); | 31 | }); |
33 | this.webview.view.addEventListener('did-navigate', () => { | 32 | this.webview.view.addEventListener('did-navigate', () => { |
34 | if (this.props.service._webview) { | 33 | if (this.props.service._webview) { |
@@ -51,7 +50,7 @@ class ServiceWebview extends Component { | |||
51 | 50 | ||
52 | refocusWebview = () => { | 51 | refocusWebview = () => { |
53 | const { webview } = this; | 52 | const { webview } = this; |
54 | console.log('Refocus Webview is called', this.props.service); | 53 | debug('Refocus Webview is called', this.props.service); |
55 | if (!webview) return; | 54 | if (!webview) return; |
56 | if (this.props.service.isActive) { | 55 | if (this.props.service.isActive) { |
57 | webview.view.blur(); | 56 | webview.view.blur(); |
@@ -64,7 +63,7 @@ class ServiceWebview extends Component { | |||
64 | } ${`- ${this.props.service._webview.getTitle()}`}`; | 63 | } ${`- ${this.props.service._webview.getTitle()}`}`; |
65 | }, 100); | 64 | }, 100); |
66 | } else { | 65 | } else { |
67 | console.log('Refocus not required - Not active service'); | 66 | debug('Refocus not required - Not active service'); |
68 | } | 67 | } |
69 | }; | 68 | }; |
70 | 69 | ||