UNPKG
@bunihq/app-bridge
Version:
latest (0.0.1)
0.0.1
0.0.1-next.3
0.0.1-next.2
0.0.1-next.1
BuniHQ App Bridge library
@bunihq/app-bridge
/
dist
/
chunk-M7RMDYQK.mjs
16 lines
(14 loc)
•
292 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// src/utils/origin.ts
function
getOrigin
(
) {
const
ancestors =
window
.
location
.
ancestorOrigins
;
if
(ancestors?.
length
) {
return
ancestors[
0
]; }
if
(
document
.
referrer
) {
return
new
URL
(
document
.
referrer
).
origin
; }
return
window
.
location
.
origin
; }
export
{ getOrigin };