bypass cache for allOrigins

This commit is contained in:
Crawlerop 2020-11-12 08:39:49 +07:00
parent a064a47d44
commit dd9ae7cd23
2 changed files with 13 additions and 2 deletions

View file

@ -10,11 +10,16 @@ var dist = 1;
up = new URLSearchParams(window.location.search)
var here = false
var cors = false
if (up.get("here") == "true") {
here = true
}
if (up.get("cors") == "true") {
cors = true
}
if (up.get("override") != null) {
try {
repdata = JSON.parse(window.atob(up.get("override"))).overrides
@ -154,7 +159,12 @@ function loadMarker(data) {
finding = false
function start2() {
xhr.open("GET", "https://api.allorigins.win/raw?url=" + encodeURIComponent(lpadURL.replace("(dist)", dist).replace("(long)", up.get("lng")).replace("(lat)", up.get("lat"))))
if (!cors) {
let rand = Math.floor(Math.random() * 1000000000000);
xhr.open("GET", "https://api.allorigins.win/raw?hash="+rand.toString()+"&url=" + encodeURIComponent(lpadURL.replace("(dist)", dist).replace("(long)", up.get("lng")).replace("(lat)", up.get("lat"))))
} else {
xhr.open("GET", lpadURL.replace("(dist)", dist).replace("(long)", up.get("lng")).replace("(lat)", up.get("lat")))
}
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
out = xhr.responseText.replace(")]}'\n", "")

View file

@ -51,7 +51,8 @@
var overrides = null;
function selLPUrl(uri) {
return cors ? uri : "https://api.allorigins.win/raw?url=" + encodeURIComponent(uri)
let rand = Math.floor(Math.random() * 1000000000000);
return cors ? uri : "https://api.allorigins.win/raw?hash="+rand.toString()+"&url=" + encodeURIComponent(uri)
}
try {