Comparing version 2.0.3 to 2.0.4
@@ -198,11 +198,11 @@ 'use strict'; | ||
frame.postMessage(payload, origin); | ||
} catch (_) { return; } | ||
if (frame.opener && frame.opener !== frame && !frame.opener.closed && frame.opener !== win) { | ||
_broadcast(frame.opener.top, payload, origin); | ||
} | ||
if (frame.opener && frame.opener !== frame && !frame.opener.closed && frame.opener !== win) { | ||
_broadcast(frame.opener.top, payload, origin); | ||
} | ||
for (i = 0; i < frame.frames.length; i++) { | ||
_broadcast(frame.frames[i], payload, origin); | ||
} | ||
for (i = 0; i < frame.frames.length; i++) { | ||
_broadcast(frame.frames[i], payload, origin); | ||
} | ||
} catch (_) { /* ignored */ } | ||
} | ||
@@ -209,0 +209,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):n.framebus=e()}(this,function(){function n(n){return null==n?!1:null==n.Window?!1:n.constructor!==n.Window?!1:(b.push(n),!0)}function e(n){var e,r={};for(e in y)y.hasOwnProperty(e)&&(r[e]=y[e]);return r._origin=n||"*",r}function r(n){var e,r,t=i(this);return u(n)?!1:u(t)?!1:(r=Array.prototype.slice.call(arguments,1),e=s(n,r,t),e===!1?!1:(g(v.top,e,t),!0))}function t(n,e){var r=i(this);return h(n,e,r)?!1:(m[r]=m[r]||{},m[r][n]=m[r][n]||[],m[r][n].push(e),!0)}function o(n,e){var r,t,o=i(this);if(h(n,e,o))return!1;if(t=m[o]&&m[o][n],!t)return!1;for(r=0;r<t.length;r++)if(t[r]===e)return t.splice(r,1),!0;return!1}function i(n){return n&&n._origin||"*"}function u(n){return"string"!=typeof n}function s(n,e,r){var t=!1,o={event:n,origin:r},i=e[e.length-1];"function"==typeof i&&(o.reply=d(i,r),e=e.slice(0,-1)),o.args=e;try{t=w+JSON.stringify(o)}catch(u){throw new Error("Could not stringify event: "+u.message)}return t}function a(n){var e,r,t,o;if(n.data.slice(0,w.length)!==w)return!1;try{e=JSON.parse(n.data.slice(w.length))}catch(i){return!1}return null!=e.reply&&(r=n.origin,t=n.source,o=e.reply,e.reply=function(n){var e=s(o,[n],r);return e===!1?!1:(t.postMessage(e,r),void 0)},e.args.push(e.reply)),e}function c(n){v||(v=n||window,v.addEventListener?v.addEventListener("message",l,!1):v.attachEvent?v.attachEvent("onmessage",l):null===v.onmessage?v.onmessage=l:v=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var e=16*Math.random()|0,r="x"===n?e:3&e|8;return r.toString(16)})}function l(n){var e;u(n.data)||(e=a(n),e&&(p("*",e.event,e.args,n),p(n.origin,e.event,e.args,n),x(n.data,e.origin,n.source)))}function p(n,e,r,t){var o;if(m[n]&&m[n][e])for(o=0;o<m[n][e].length;o++)m[n][e][o].apply(t,r)}function g(n,e,r){var t;try{n.postMessage(e,r)}catch(o){return}for(n.opener&&n.opener!==n&&!n.opener.closed&&n.opener!==v&&g(n.opener.top,e,r),t=0;t<n.frames.length;t++)g(n.frames[t],e,r)}function x(n,e,r){var t,o;for(t=b.length-1;t>=0;t--)o=b[t],o.closed===!0?b=b.slice(t,1):r!==o&&g(o.top,n,e)}function d(n,e){function r(o,i){n(o,i),y.target(e).unsubscribe(t,r)}var t=f();return y.target(e).subscribe(t,r),t}function h(n,e,r){return u(n)?!0:"function"!=typeof e?!0:u(r)?!0:!1}var v,y,b=[],m={},w="/*framebus*/";return c(),y={target:e,include:n,publish:r,pub:r,trigger:r,emit:r,subscribe:t,sub:t,on:t,unsubscribe:o,unsub:o,off:o}}); | ||
"use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):n.framebus=e()}(this,function(){function n(n){return null==n?!1:null==n.Window?!1:n.constructor!==n.Window?!1:(b.push(n),!0)}function e(n){var e,r={};for(e in y)y.hasOwnProperty(e)&&(r[e]=y[e]);return r._origin=n||"*",r}function r(n){var e,r,t=i(this);return u(n)?!1:u(t)?!1:(r=Array.prototype.slice.call(arguments,1),e=s(n,r,t),e===!1?!1:(g(v.top,e,t),!0))}function t(n,e){var r=i(this);return h(n,e,r)?!1:(m[r]=m[r]||{},m[r][n]=m[r][n]||[],m[r][n].push(e),!0)}function o(n,e){var r,t,o=i(this);if(h(n,e,o))return!1;if(t=m[o]&&m[o][n],!t)return!1;for(r=0;r<t.length;r++)if(t[r]===e)return t.splice(r,1),!0;return!1}function i(n){return n&&n._origin||"*"}function u(n){return"string"!=typeof n}function s(n,e,r){var t=!1,o={event:n,origin:r},i=e[e.length-1];"function"==typeof i&&(o.reply=d(i,r),e=e.slice(0,-1)),o.args=e;try{t=w+JSON.stringify(o)}catch(u){throw new Error("Could not stringify event: "+u.message)}return t}function a(n){var e,r,t,o;if(n.data.slice(0,w.length)!==w)return!1;try{e=JSON.parse(n.data.slice(w.length))}catch(i){return!1}return null!=e.reply&&(r=n.origin,t=n.source,o=e.reply,e.reply=function(n){var e=s(o,[n],r);return e===!1?!1:(t.postMessage(e,r),void 0)},e.args.push(e.reply)),e}function c(n){v||(v=n||window,v.addEventListener?v.addEventListener("message",l,!1):v.attachEvent?v.attachEvent("onmessage",l):null===v.onmessage?v.onmessage=l:v=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var e=16*Math.random()|0,r="x"===n?e:3&e|8;return r.toString(16)})}function l(n){var e;u(n.data)||(e=a(n),e&&(p("*",e.event,e.args,n),p(n.origin,e.event,e.args,n),x(n.data,e.origin,n.source)))}function p(n,e,r,t){var o;if(m[n]&&m[n][e])for(o=0;o<m[n][e].length;o++)m[n][e][o].apply(t,r)}function g(n,e,r){var t;try{for(n.postMessage(e,r),n.opener&&n.opener!==n&&!n.opener.closed&&n.opener!==v&&g(n.opener.top,e,r),t=0;t<n.frames.length;t++)g(n.frames[t],e,r)}catch(o){}}function x(n,e,r){var t,o;for(t=b.length-1;t>=0;t--)o=b[t],o.closed===!0?b=b.slice(t,1):r!==o&&g(o.top,n,e)}function d(n,e){function r(o,i){n(o,i),y.target(e).unsubscribe(t,r)}var t=f();return y.target(e).subscribe(t,r),t}function h(n,e,r){return u(n)?!0:"function"!=typeof e?!0:u(r)?!0:!1}var v,y,b=[],m={},w="/*framebus*/";return c(),y={target:e,include:n,publish:r,pub:r,trigger:r,emit:r,subscribe:t,sub:t,on:t,unsubscribe:o,unsub:o,off:o}}); |
@@ -9,3 +9,3 @@ { | ||
"homepage": "https://github.com/braintree/framebus", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"main": "dist/framebus.js", | ||
@@ -12,0 +12,0 @@ "browser": "dist/framebus.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16826