mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-21 07:32:54 +01:00
Added a special error case for Brave browser
Affects issues: - Notifies of #1406 #1425
This commit is contained in:
parent
45d95ad2f3
commit
b7e1261597
@ -24,9 +24,14 @@ function jsonRequest(address, callback) {
|
|||||||
callback(null, "Request did not reach the server. (Server offline / Adblocker?)")
|
callback(null, "Request did not reach the server. (Server offline / Adblocker?)")
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (e.message.includes('Unexpected end of JSON input') && navigator.brave && navigator.brave.isBrave) {
|
||||||
|
navigator.brave.isBrave()
|
||||||
|
.then(confirm => callback(null, e.message + (confirm ? " (Possibly blocked by ad-block in Brave)" : '') + " (See " + address + ")"));
|
||||||
|
} else {
|
||||||
callback(null, e.message + " (See " + address + ")")
|
callback(null, e.message + " (See " + address + ")")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
xhttp.timeout = 45000;
|
xhttp.timeout = 45000;
|
||||||
xhttp.ontimeout = function () {
|
xhttp.ontimeout = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user