aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/services/content
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-10-27 14:52:48 +0100
committerLibravatar vantezzen <hello@vantezzen.io>2019-10-27 14:52:48 +0100
commit92491b320813e882a3735afee3134965915adea9 (patch)
treebe97d66a10eb478e54e0b17341fd41ceddef1cff /src/components/services/content
parentRemove hiberation hack as observer is fixed (diff)
downloadferdium-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')
-rw-r--r--src/components/services/content/ServiceWebview.js5
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';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import { observable, reaction } from 'mobx'; 4import { observable, reaction } from 'mobx';
5import ElectronWebView from 'react-electron-web-view'; 5import ElectronWebView from 'react-electron-web-view';
6import path from 'path';
6 7
7import ServiceModel from '../../../models/Service'; 8import 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({