MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / isValidOrigin

Function isValidOrigin

src/client-API/client-api.js:671–681  ·  view source on GitHub ↗
(msgOrigin)

Source from the content-addressed store, hash-verified

669}
670
671function isValidOrigin(msgOrigin) {
672 // Normal behavior
673 if (msgOrigin === window.location.origin) {
674 return true;
675 }
676 // Dev mode extension for file protocol
677 if (typeof __DEV_MODE__ !== 'undefined' && __DEV_MODE__ && window.location.protocol === 'file:') {
678 return msgOrigin === 'null' || msgOrigin === 'file://';
679 }
680 return false;
681}
682
683function eventListener(msg) {
684 if (!isValidOrigin(msg.origin) ||

Callers 1

eventListenerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected