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
const CrossOriginLocalStorage = function(currentWindow, iframe, allowedOrigins, onMessage) { | |
this.allowedOrigins = allowedOrigins; | |
let childWindow; | |
// some browser (don't remember which one) throw exception when you try to access | |
// contentWindow for the first time, it works when you do that second time | |
try { | |
childWindow = iframe.contentWindow; | |
} catch(e) { | |
childWindow = iframe.contentWindow; |