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

@aplazame/browser

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aplazame/browser - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

16

lib/AplazameIFrame.js

@@ -9,6 +9,7 @@

export class AplazameIFrame extends EventEmitter {
#allowMessage = e => e.data?.source === 'aplazame'
#allowFilter = e => e.data?.source === 'aplazame'
#sendData = { source: 'aplazame' }
#requestTimeout = 60000
constructor ({ url = null, searchParams = null, requestTimeout = null } = {}) {
constructor ({ url = null, searchParams = null, requestTimeout = null, allowFilter = null, messageData = null } = {}) {
super({ Event: AplazameEvent })

@@ -22,2 +23,4 @@

if (allowFilter) this.#allowFilter = allowFilter
if (messageData) this.#messageData = messageData
if (requestTimeout) this.#requestTimeout = requestTimeout

@@ -27,3 +30,3 @@ }

#onMessage (e) {
if (!this.#allowMessage(e)) return
if (!this.#allowFilter(e)) return

@@ -39,3 +42,3 @@ if (e.data?.event) {

return new Promise(resolve => {
this.iframe.contentWindow.postMessage({ source: 'aplazame', request, payload }, '*')
this.iframe.contentWindow.postMessage({ ...this.#sendData, request, payload }, '*')
const onResponse = () => {

@@ -51,2 +54,7 @@ this.off(request, onResponse)

async send (event, _payload) {
const payload = _payload ? copyObject(_payload) : _payload
this.iframe.contentWindow.postMessage({ ...this.#sendData, event, payload }, '*')
}
mount (el) {

@@ -53,0 +61,0 @@ this.mount_el = el

{
"name": "@aplazame/browser",
"version": "0.0.8",
"version": "0.0.9",
"description": "Aplazame SDK for browser",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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