Skip to content

Commit

Permalink
feat: add Pale Moon browser support (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetakify authored Nov 17, 2023
1 parent 29222b2 commit bb8f94e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const BROWSER_ALIASES_MAP = {
'NAVER Whale Browser': 'naver',
Opera: 'opera',
'Opera Coast': 'opera_coast',
'Pale Moon': 'pale_moon',
PhantomJS: 'phantomjs',
Puffin: 'puffin',
QupZilla: 'qupzilla',
Expand Down Expand Up @@ -64,6 +65,7 @@ export const BROWSER_MAP = {
naver: 'NAVER Whale Browser',
opera: 'Opera',
opera_coast: 'Opera Coast',
pale_moon: 'Pale Moon',
phantomjs: 'PhantomJS',
puffin: 'Puffin',
qupzilla: 'QupZilla',
Expand Down
15 changes: 15 additions & 0 deletions src/parser-browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ const browsersList = [
return browser;
},
},
{
test: [/PaleMoon/i],
describe(ua) {
const browser = {
name: 'Pale Moon',
};
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i, ua);

if (version) {
browser.version = version;
}

return browser;
},
},
{
test: [/MZBrowser/i],
describe(ua) {
Expand Down
29 changes: 29 additions & 0 deletions test/acceptance/useragentstrings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3054,3 +3054,32 @@
type: "mobile"
engine:
name: "Blink"
Pale Moon:
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.1.1"
spec:
browser:
name: "Pale Moon"
version: "29.1.1"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Gecko"
version: "20100101"
-
ua: "Mozilla/5.0 (X11; Linux i686; rv:45.9) Gecko/20100101 Goanna/3.2 Firefox/45.9 PaleMoon/27.2.0"
spec:
browser:
name: "Pale Moon"
version: "27.2.0"
os:
name: "Linux"
platform:
type: "desktop"
engine:
name: "Gecko"
version: "20100101"

0 comments on commit bb8f94e

Please sign in to comment.