-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron.js
29 lines (23 loc) · 839 Bytes
/
electron.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf(' electron/') > -1) {
// let meta = document.createElement('meta');
// meta.httpEquiv = "Content-Security-Policy";
// // meta.content = "script-src 'self'";
// meta.content = "default-src 'none'";
// document.getElementsByTagName('head')[0].appendChild(meta);
// Fix to make jQuery work in electron, see https://stackoverflow.com/questions/32621988/electron-jquery-is-not-defined
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
const Store = require('../store.js')
// Create a store to load config file
const store = new Store({
// We'll call our data file 'user-preferences'
configName: 'user-preferences',
defaults: {
port: 6842
}
})
window.localStorage.setItem('port', store.get('port'));
}