Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions capy/src/main/java/com/jocmp/capy/common/WindowOrigin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ package com.jocmp.capy.common
import java.net.MalformedURLException
import java.net.URL

/**
* List of hosts that should skip the site's origin
* so that images will load correctly
*/
val skipOrigin = listOf(
"www.qbitai.com"
)

/**
* https://developer.mozilla.org/en-US/docs/Web/API/Window/origin
*
Expand All @@ -13,6 +21,10 @@ fun windowOrigin(url: URL?): String? {
return null
}

if (skipOrigin.contains(url.host)) {
return null
}

return try {
URL(url.protocol, url.host, url.port, "", null).toString()
} catch (e: MalformedURLException) {
Expand Down
Loading