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

Opera sniff be gone! #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions jquery.ba-postmessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@

p_receiveMessage,

// I couldn't get window.postMessage to actually work in Opera 9.64!
has_postMessage = window[postMessage] && !$.browser.opera;
has_postMessage = window[postMessage];

// Method: jQuery.postMessage
//
Expand Down Expand Up @@ -179,6 +178,12 @@
// Bind the callback. A reference to the callback is stored for ease of
// unbinding.
rm_callback = function(e) {
// Opera <10 uses event.domain and doesn't include the http:// prefix
if(e.domain) {
source_origin = source_origin.split("://")[1];
e.origin = e.domain;
}

if ( ( typeof source_origin === 'string' && e.origin !== source_origin )
|| ( $.isFunction( source_origin ) && source_origin( e.origin ) === FALSE ) ) {
return FALSE;
Expand Down