Skip to content

Commit 54a7a9b

Browse files
committed
Skip image window origin for qbitai.com
1 parent dd55c50 commit 54a7a9b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

capy/src/main/java/com/jocmp/capy/common/WindowOrigin.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ package com.jocmp.capy.common
33
import java.net.MalformedURLException
44
import java.net.URL
55

6+
/**
7+
* List of hosts that should skip the site's origin
8+
* so that images will load correctly
9+
*/
10+
val skipOrigin = listOf(
11+
"www.qbitai.com"
12+
)
13+
614
/**
715
* https://developer.mozilla.org/en-US/docs/Web/API/Window/origin
816
*
@@ -13,6 +21,10 @@ fun windowOrigin(url: URL?): String? {
1321
return null
1422
}
1523

24+
if (skipOrigin.contains(url.host)) {
25+
return null
26+
}
27+
1628
return try {
1729
URL(url.protocol, url.host, url.port, "", null).toString()
1830
} catch (e: MalformedURLException) {

0 commit comments

Comments
 (0)