Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created March 16, 2015 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/450a9d2ff3a1193e9b89 to your computer and use it in GitHub Desktop.
Save NetanelBasal/450a9d2ff3a1193e9b89 to your computer and use it in GitHub Desktop.
window post message
var params = $window.location.search.substring(1);
if(params && $window.opener) {
var pair = params.split('=');
$window.opener.postMessage(pair[1], $window.location.origin);
}
var popup = this.$window.open('auth/facebook', '', 'width=500, height=500');
this.$window.focus();
this.$window.addEventListener('message', (e) => {
if(e.data === 'yes') {
popup.close();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment