Skip to content

Instantly share code, notes, and snippets.

View Dagur's full-sized avatar

Dagur Páll Ammendrup Dagur

View GitHub Profile
@medmunds
medmunds / winstate.js
Created May 9, 2015 00:41
Save and restore window state for Electron (Atom-Shell)
// Preserve and restore window state in localStorage.
// Adapted for Electron from nw.js:
// https://github.com/nwjs/nw.js/wiki/Preserve-window-state-between-sessions
//
// As written, it only handles a single-window app.
//
// This code is meant to run in the renderer process.
// To use, load from index.html (or whatever file you loadUrl into your BrowserWindow):
// <script src="winstate.js"></script>