()
| 36 | } |
| 37 | |
| 38 | function getTargetOrigin() { |
| 39 | const origin = window.location.origin; |
| 40 | // Dev mode: Use wildcard for file protocol, otherwise use normal origin |
| 41 | if (typeof __DEV_MODE__ !== 'undefined' && __DEV_MODE__ && origin === 'file://') { |
| 42 | return '*'; |
| 43 | } |
| 44 | return origin; |
| 45 | } |
| 46 | |
| 47 | export function init() { |
| 48 | const apiTag = document.getElementById('mailvelope-api'); |