Skip to content

Commit

Permalink
Added chatgpt.browser.isBrave()
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jun 23, 2024
1 parent 9822d45 commit 363724d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
isChromium: function() { return navigator.userAgent.includes('Chrome'); },
isChrome: function() { return !!JSON.stringify(navigator.userAgentData?.brands)?.includes('Chrome'); },
isEdge: function() { return navigator.userAgent.includes('Edg'); },
isBrave: function() { return !!JSON.stringify(navigator.userAgentData?.brands)?.includes('Brave'); },
isFirefox: function() { return navigator.userAgent.includes('Firefox'); },

isFullScreen: function() {
Expand Down
13 changes: 13 additions & 0 deletions docs/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
- [isDarkMode](#isdarkmode-1)
- [isChromium](#ischromium-1)
- [isEdge](#isedge-1)
- [isBrave](#isbrave)
- [isFirefox](#isfirefox-1)
- [isFullScreen](#isfullscreen-1)
- [isMobile](#ismobile)
Expand Down Expand Up @@ -1347,6 +1348,18 @@ if (chatgpt.browser.isEdge()) {
}
```

### isBrave

Returns a boolean value. `true` if the browser is Brave and `false` otherwise.

Example code:

```js
if (chatgpt.browser.isBrave()) {
// Do something
}
```

### isFirefox

Returns a boolean value. `true` if the browser is Firefox and `false` otherwise.
Expand Down

0 comments on commit 363724d

Please sign in to comment.