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

Function isValidOrigin

src/content-scripts/clientAPI.js:26–36  ·  view source on GitHub ↗
(msgOrigin)

Source from the content-addressed store, hash-verified

24export let clientPort = null;
25
26function isValidOrigin(msgOrigin) {
27 // Normal behavior
28 if (msgOrigin === window.location.origin) {
29 return true;
30 }
31 // Dev mode extension for file protocol
32 if (typeof __DEV_MODE__ !== 'undefined' && __DEV_MODE__ && window.location.protocol === 'file:') {
33 return msgOrigin === 'null' || msgOrigin === 'file://';
34 }
35 return false;
36}
37
38function getTargetOrigin() {
39 const origin = window.location.origin;

Callers 1

addListenerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected