Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "sysend", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Send messages to other tabs/windows in the same browser", | ||
@@ -5,0 +5,0 @@ "main": "sysend.js", |
@@ -1,3 +0,3 @@ | ||
[![npm](https://img.shields.io/badge/npm-1.3.1-blue.svg)](https://www.npmjs.com/package/sysend) | ||
![bower](https://img.shields.io/badge/bower-1.3.1-yellow.svg) | ||
[![npm](https://img.shields.io/badge/npm-1.3.2-blue.svg)](https://www.npmjs.com/package/sysend) | ||
![bower](https://img.shields.io/badge/bower-1.3.2-yellow.svg) | ||
![downloads](https://img.shields.io/npm/dt/sysend.svg) | ||
@@ -4,0 +4,0 @@ |
/**@license | ||
* sysend.js - send messages between browser windows/tabs version 1.3.1 | ||
* sysend.js - send messages between browser windows/tabs version 1.3.2 | ||
* | ||
@@ -62,2 +62,9 @@ * Copyright (C) 2014-2018 Jakub Jankiewicz <http://jcubic.pl/me> | ||
} | ||
var host = (function() { | ||
var a = document.createElement('a'); | ||
return function(url) { | ||
a.href = url; | ||
return a.host; | ||
}; | ||
})(); | ||
function send_to_iframes(key, data) { | ||
@@ -141,5 +148,6 @@ // propagate events to iframes | ||
proxy: function(url) { | ||
if (typeof url === 'string' && !url.match(new RegExp(window.location.host, 'i'))) { | ||
if (typeof url === 'string' && host(url) !== window.location.host) { | ||
var iframe = document.createElement('iframe'); | ||
iframe.style.visibility = 'hidden'; | ||
iframe.style.width = iframe.style.height = 0; | ||
iframe.style.border = 'none'; | ||
var proxy_url = url; | ||
@@ -146,0 +154,0 @@ if (!url.match(/\.html$/)) { |
Sorry, the diff of this file is not supported yet
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
15914
224