New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cors-window

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cors-window

CORS-Origin window/iframe comunication

  • 0.0.0-alpha.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cors-window

Cross-origin window/iframe communication

Example

Host

const host = new DialogHost("http://localhost:7702")
host.onMessage = (data) => {
    console.log("child sent msg", data)
}
host.onChildAttach = () => {
    console.log("host has attached to existing window")
}
host.onChildOpen = () => {
    console.log("child opened a new window")
}
host.onChildClose = () => {
    console.log("child window closed")
}
setInterval(() => {
  host.post({ type: "ok", data: "data from host" })
}, 1500)

Dialog

const dialog = new DialogWindow();
dialog.onMessage = (data) => {
    console.log("parent sent message", data)
}
dialog.onParentOpen = () => {
    console.log("parent opend this window")
}
dialog.onParentAttach = () => {
    console.log("parent refreshed the window")
}
dialog.onParentClose = () => {
    console.log("parent closed the window")
}
setInterval(() => {
  dialog.post({ type: "ok", data: "data from dialog" })
}, 1500)

Examples

For full examples go to example directory

Keywords

FAQs

Package last updated on 16 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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