Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inframejs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inframejs - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "inframejs",
"version": "1.0.6",
"version": "1.0.7",
"description": "use pure Javascript to connect the iframe pages",

@@ -5,0 +5,0 @@ "main": "dist/inframejs.es.min.js",

@@ -53,3 +53,3 @@ import {version} from '../package.json'

if (typeof target === 'string') {
this.target = document.querySelector(target);
this.target = document.querySelector(target)
} else if (typeof target !== 'undefined') {

@@ -60,2 +60,3 @@ this.target = target

}
}

@@ -92,21 +93,27 @@

this.logger(`${eventName} has been emit::${JSON.stringify(msg)}`)
if(this.isConneted){
if(this.isSubPage){
// 子页面
if(this.isNewWindow){
window.opener.postMessage(msg,'*')
try {
if(this.isConneted){
if(this.isSubPage){
// 子页面
if(this.isNewWindow){
window.opener.postMessage(msg,'*')
} else {
window.parent.postMessage(msg,'*')
}
} else {
window.parent.postMessage(msg,'*')
// 主页面通过window.open打开了
if(this.isNewWindow){
this.target.postMessage(msg,'*')
} else {
this.target.contentWindow.postMessage(msg,'*')
}
}
} else {
// 主页面通过window.open打开了
if(this.isNewWindow){
this.target.postMessage(msg,'*')
} else {
this.target.contentWindow.postMessage(msg,'*')
}
this.emitCache.push({eventName, data})
}
} else {
this.emitCache.push({eventName, data})
} catch (e){
this.logger(e.message)
this.destroy()
}
}

@@ -125,3 +132,3 @@

if (this.whiteList.length) {
const checked = this.whiteList.some(domain => ~domain.indexOf(e.origin))
const checked = this.whiteList.some(domain => domain.indexOf(e.origin) > -1)
if (!checked) {

@@ -128,0 +135,0 @@ console.warn('you are not access to inframe')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc