Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do run reload() and open() in Atom-Shell

1) Is this javascript call not supported on Atom-shell? window.open('#/openpage','_self',false)

2) In NodeJS-Webkit, I could either reload the HTML with win.reload() without the toolbar and buttons. Is Atom-shell support this API as well?

3) In the app.js that is program to index.html into the Atom-shell

var BrowserWindow = require('browser-window');

and index.html tried to execute a reload command and failed that BrowserWindow is not defined.

BrowserWindow.reload()
like image 900
James Lei Avatar asked Jan 06 '15 00:01

James Lei


People also ask

How do I clear my Electron browser cache?

CTRL+SHIFT+I opens up the dev tools in Electron apps. This answer is one of possible solutions. Thank you, this is helpful if you just need to quickly clear the cache without writing code for it for a one time thing. The original question wasn't clear that it needed a code solution or a 1 time solution.


1 Answers

browser-window only works in the Browser process (i.e. the one your app starts in). Try this:

var remote = require('remote');
remote.getCurrentWindow().reload();
like image 196
Ana Betts Avatar answered Sep 28 '22 11:09

Ana Betts