I've been fiddling around with electron's remote module. In my main-process I've created this variable:
global.storage = {};
My renderer-process is initialised with a file called startup.html.
win.loadURL('file://' + __dirname + '/startup.html')
In there, I include a javascript file containing the following function:
function enterMain(value){
remote.getGlobal('storage').exmpl = value;
window.location.replace('./general.html');
}
The value I'm passing is "hello", and when calling upon...
console.log(remote.getGlobal('storage').exmpl);
...after assigning the value it returns "hello", as it should. However, once the window location has been replaced to general.html, in which I include a javascript file containing this function:
$(document).ready(function(){
console.log(remote.getGlobal('storage').exmpl);
});
...it returns undefined. Why? Can anyone help me make sense of this?