Skip to content

Instantly share code, notes, and snippets.

View dknoodle's full-sized avatar

Daniel Knoodle dknoodle

  • Invictus Gurus, LLC
  • Dallas, TX
View GitHub Profile
@neilj
neilj / window-controller.js
Last active November 4, 2022 21:41
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );