mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-01 14:07: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,7 +24,12 @@ function jsonRequest(address, callback) {
|
||||
callback(null, "Request did not reach the server. (Server offline / Adblocker?)")
|
||||
}
|
||||
} catch (e) {
|
||||
callback(null, e.message + " (See " + address + ")")
|
||||
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 + ")")
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user