Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] support for Array in source_origin #15

Open
erich-roncarolo opened this issue Jan 22, 2014 · 0 comments
Open

[enhancement] support for Array in source_origin #15

erich-roncarolo opened this issue Jan 22, 2014 · 0 comments

Comments

@erich-roncarolo
Copy link

Maybe source_origin could support also arrays.
In this way receiveMessage() can be invoked in following way:

$.receiveMessage(function(e) {
    ....
}, [
    'http://example.com',
    'http://test.example.com',
    'https://example.com'
]);

The change should be simple, just add following line in receiveMessage() between line 182 and line 183.

182       if ( ( typeof source_origin === 'string' && e.origin !== source_origin )
==>         || ( $.isArray( source_origin ) && $.inArray( e.origin, source_origin ) === -1 )
183         || ( $.isFunction( source_origin ) && source_origin( e.origin ) === FALSE ) ) {
184         return FALSE;
185       }

Regards
-Erich

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant