Skip to content

Commit ae84222

Browse files
YevhenPolovnyiDamonOehlman
authored andcommitted
Add detect Opera Developer (#104)
1 parent 4442087 commit ae84222

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const userAgentRules: UserAgentRule[] = [
108108
['fxios', /FxiOS\/([0-9\.]+)/],
109109
['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/],
110110
['opera', /Opera\/([0-9\.]+)(?:\s|$)/],
111-
['opera', /OPR\/([0-9\.]+)(:?\s|$)$/],
111+
['opera', /OPR\/([0-9\.]+)(:?\s|$)/],
112112
['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],
113113
['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],
114114
['ie', /MSIE\s(7\.0)/],

test/logic.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ test('detects Opera', function(t) {
115115
{ name: 'opera', version: '38.0.2220', os: 'Mac OS' }
116116
);
117117

118+
assertAgentString(t,
119+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36 OPR/61.0.3282.0 (Edition developer)',
120+
{ name: 'opera', version: '61.0.3282', os: 'Mac OS' }
121+
);
122+
118123
t.end();
119124
});
120125

0 commit comments

Comments
 (0)