Skip to content

Commit

Permalink
Update worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kerivin authored Nov 22, 2024
1 parent ffabc5e commit a750109
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,11 @@ async function onInlineQuery (inlineQuery) {
return true
}
console.log("Regex detected: ", entry.source)

const keepSearching = entry.target.every(function(target) {
const checkURL = new URL(url.toString())
checkURL.hostname = target
if (!urlExists(checkURL.toString())) {
return true
}

url = checkURL
title = entry.name
console.log("Valid target URL: ", validTarget)
return false
})

return keepSearching
//url.hostname.replace(regex, entry.target)
url.hostname = entry.target
console.log("New hostname: ", url.hostname)
title = entry.name
return false
})

console.log("Fixed URL: ", url)
Expand Down

0 comments on commit a750109

Please sign in to comment.