Skip to content

Commit

Permalink
Add support for bracket browser
Browse files Browse the repository at this point in the history
  • Loading branch information
oxmc committed Dec 24, 2023
1 parent 321eace commit d2aa8a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OS-Detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ window.osd.detectOS = async function (opts) {
} else if (useragent.includes("Chrom") || useragent.includes("CriOS")) {
if (useragent.includes("Edg") || useragent.includes("Edge")) {
browserName = "Edge (chromium)";
} else if (useragent.includes("BracketBrowser") || useragent.includes("BracketBrowser")) {
browserName = "BracketBrowser (electron)";
} else if (useragent.includes("Chromium")) {
browserName = "Chromium";
} else {
Expand Down Expand Up @@ -102,6 +104,8 @@ window.osd.detectOS = async function (opts) {
function getChromeVersion(useragent) {
if (useragent.includes("Edg") || useragent.includes("Edge")) {
return useragent.includes("Edg/") ? `${getVersion(useragent, 'Edg/')}` : `${getVersion(useragent, 'Edge/')}`;
} else if (useragent.includes("BracketBrowser/")) {
return useragent.split("BracketBrowser/")[1].split(" ")[0].trim() || "";
} else if (useragent.includes("Puffin/")) {
return getVersion(useragent, 'Puffin/');
} else if (useragent.includes("CriOS")) {
Expand Down

0 comments on commit d2aa8a8

Please sign in to comment.