diff options
author | 2019-10-27 14:52:48 +0100 | |
---|---|---|
committer | 2019-10-27 14:52:48 +0100 | |
commit | 92491b320813e882a3735afee3134965915adea9 (patch) | |
tree | be97d66a10eb478e54e0b17341fd41ceddef1cff /src/components/services/content/ServiceWebview.js | |
parent | Remove hiberation hack as observer is fixed (diff) | |
download | ferdium-app-92491b320813e882a3735afee3134965915adea9.tar.gz ferdium-app-92491b320813e882a3735afee3134965915adea9.tar.zst ferdium-app-92491b320813e882a3735afee3134965915adea9.zip |
Use absolute file path to preload recipe
Diffstat (limited to 'src/components/services/content/ServiceWebview.js')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index e6ebb6afb..652647470 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; | |||
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { observable, reaction } from 'mobx'; | 4 | import { observable, reaction } from 'mobx'; |
5 | import ElectronWebView from 'react-electron-web-view'; | 5 | import ElectronWebView from 'react-electron-web-view'; |
6 | import path from 'path'; | ||
6 | 7 | ||
7 | import ServiceModel from '../../../models/Service'; | 8 | import ServiceModel from '../../../models/Service'; |
8 | 9 | ||
@@ -51,6 +52,8 @@ class ServiceWebview extends Component { | |||
51 | setWebviewReference, | 52 | setWebviewReference, |
52 | } = this.props; | 53 | } = this.props; |
53 | 54 | ||
55 | const preloadScript = path.join(__dirname, '../../../', 'webview', 'recipe.js'); | ||
56 | |||
54 | return ( | 57 | return ( |
55 | <ElectronWebView | 58 | <ElectronWebView |
56 | ref={(webview) => { | 59 | ref={(webview) => { |
@@ -61,7 +64,7 @@ class ServiceWebview extends Component { | |||
61 | }} | 64 | }} |
62 | autosize | 65 | autosize |
63 | src={service.url} | 66 | src={service.url} |
64 | preload="./webview/recipe.js" | 67 | preload={preloadScript} |
65 | partition={`persist:service-${service.id}`} | 68 | partition={`persist:service-${service.id}`} |
66 | onDidAttach={() => { | 69 | onDidAttach={() => { |
67 | setWebviewReference({ | 70 | setWebviewReference({ |