Fix #639: Only check for Brave properties if given userAgent match the current userAgent

This commit is contained in:
Faisal Salman 2023-03-26 11:57:17 +07:00
parent e70d09a1f8
commit 82567c28ab

View File

@ -987,7 +987,7 @@
switch(this.itemType) { switch(this.itemType) {
case UA_BROWSER: case UA_BROWSER:
// Brave-specific detection // Brave-specific detection
if (NAVIGATOR && NAVIGATOR.brave && typeof NAVIGATOR.brave.isBrave == FUNC_TYPE) { if (NAVIGATOR && NAVIGATOR.userAgent == ua && NAVIGATOR.brave && typeof NAVIGATOR.brave.isBrave == FUNC_TYPE) {
this.set(NAME, 'Brave'); this.set(NAME, 'Brave');
} }
this.set(MAJOR, majorize(this.get(VERSION))); this.set(MAJOR, majorize(this.get(VERSION)));