(msgOrigin)
| 24 | export let clientPort = null; |
| 25 | |
| 26 | function 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 | |
| 38 | function getTargetOrigin() { |
| 39 | const origin = window.location.origin; |