peterhudec/authomatic — pull request #51 by damirm (2014-06-02 23:15:31+00:00)
Title: chrome ios window.opener is undefined fix

Hello!
I encountered a problem: authomatic not working in iOS Chrome, because in Chrome iOS ```window.opener``` is undefined. When child window tries to call parent function ```window.opener.authomatic.loginComplete(result, closer);```
raises exception, and ```closer``` function not called never, child window not closing, parent window can't get any auth result.

This is known behavior of iOS Chrome. Look at this issues:
https://code.google.com/p/chromium/issues/detail?id=116729
https://code.google.com/p/chromium/issues/detail?id=136610

I propose a solution to this problem. The main idea in use ```localStorage```, and put result data to them, if window.opener is undefined. Before child window is not open, we check browser for matching with iOS Chrome. If browser is iOS Chrome - then setTimeout function, which check localStorage for availability any data different from null or undefined. When localStorage is not empty - call ``` authomatic.loginComplete```function, and put data from localStorage as arguments for this function.

P.S. Sorry for my English :-( I'm working on it..