@airgap/beacon-transport-postmessage
Advanced tools
Comparing version 3.0.0-beta.0 to 3.0.0-beta.1
@@ -160,2 +160,6 @@ "use strict"; | ||
case 0: | ||
if (event.source !== beacon_core_1.windowRef || event.origin !== beacon_core_1.windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return [2 /*return*/]; | ||
} | ||
data = (_g = event === null || event === void 0 ? void 0 : event.data) === null || _g === void 0 ? void 0 : _g.message; | ||
@@ -235,2 +239,7 @@ _a = data && | ||
beacon_core_1.windowRef.addEventListener('message', function (message) { | ||
if (message.source !== beacon_core_1.windowRef || | ||
message.origin !== beacon_core_1.windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return; | ||
} | ||
if (typeof message === 'object' && message) { | ||
@@ -237,0 +246,0 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any |
@@ -134,2 +134,6 @@ "use strict"; | ||
var fn = function (event) { | ||
if (event.source !== beacon_core_1.windowRef || event.origin !== beacon_core_1.windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return; | ||
} | ||
var data = event.data; | ||
@@ -136,0 +140,0 @@ var sender = data.sender; |
@@ -68,2 +68,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _a, _b; | ||
if (event.source !== windowRef || event.origin !== windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return; | ||
} | ||
const data = (_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.message; | ||
@@ -107,2 +111,7 @@ if (data && | ||
windowRef.addEventListener('message', (message) => { | ||
if (message.source !== windowRef || | ||
message.origin !== windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return; | ||
} | ||
if (typeof message === 'object' && message) { | ||
@@ -109,0 +118,0 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any |
@@ -83,2 +83,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const fn = (event) => { | ||
if (event.source !== windowRef || event.origin !== windowRef.location.origin) { | ||
// TODO: Add to error handler: console.debug('[Beacon]: Event received from untrusted origin') | ||
return; | ||
} | ||
const data = event.data; | ||
@@ -85,0 +89,0 @@ const sender = data.sender; |
{ | ||
"name": "@airgap/beacon-transport-postmessage", | ||
"version": "3.0.0-beta.0", | ||
"version": "3.0.0-beta.1", | ||
"description": "> TODO: description", | ||
@@ -37,9 +37,9 @@ "author": "Andreas Gassmann <a.gassmann@papers.ch>", | ||
"dependencies": { | ||
"@airgap/beacon-core": "^3.0.0-beta.0", | ||
"@airgap/beacon-types": "^3.0.0-beta.0", | ||
"@airgap/beacon-utils": "^3.0.0-beta.0", | ||
"@airgap/beacon-core": "^3.0.0-beta.1", | ||
"@airgap/beacon-types": "^3.0.0-beta.1", | ||
"@airgap/beacon-utils": "^3.0.0-beta.1", | ||
"@types/libsodium-wrappers": "0.7.9", | ||
"libsodium-wrappers": "0.7.9" | ||
}, | ||
"gitHead": "ffcd36eac1b9d227c31820d2d1ebdc53eedcee9e" | ||
"gitHead": "08dd30117218782c0c9a70151ec2b3be185e6cc8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
61563
857