Last active
December 11, 2015 02:48
-
-
Save dcneiner/4532957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shouldSerialize = (function () { | |
var serialize = false; | |
window.addEventListener( "message", function callback ( e ) { | |
serialize = e.data.sample === true; | |
window.removeEventListener( "message", callback ); | |
}, false); | |
window.postMessage( { sample: true }, "*" ); | |
return serialize; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment