diff --git a/preload.js b/preload.js index 840b9c5e0..2ba77f103 100644 --- a/preload.js +++ b/preload.js @@ -1,15 +1,11 @@ -/* - * Pending electron 1.6.x - * const env = require('url').parse(window.location, true).query; -*/ +(function () { + 'use strict'; + console.log('preload'); + const electron = require('electron') -console.log('preload'); + window.config = require('url').parse(window.location.toString(), true).query; -window.config = {}; -window.location.search.substring(1).split('&').forEach(function(variable) { - var pair = variable.split('='); - config[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); -}); + const ipc = electron.ipcRenderer + window.config.locale_json = ipc.sendSync('locale-data'); -const ipc = require('electron').ipcRenderer -window.config.locale_json = ipc.sendSync('locale-data'); +})();