0
0

🩹 use /lookup on current domain

This commit is contained in:
thetek 2021-07-29 12:43:48 +02:00
parent a67fb81703
commit 314bee5a84

View File

@ -20,7 +20,11 @@ function dnswatch_search() {
// send api request
var request = new XMLHttpRequest();
request.open('POST', 'https://dns-watch.org/lookup', true);
request.open('POST',
window.location.hostname === ''
? 'https://dns-watch.org/lookup' // send request to the official website when running the .html locally
: `https://${window.location.hostname}/lookup`, // send request to /lookup if not running locally
true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
request.onload = function() {