Skip to content

Commit b7503ac

Browse files
Fixed Opera detected and added a separate release channel (#1530)
1 parent c92a1dc commit b7503ac

File tree

1 file changed

+25
-10
lines changed
  • extension-manifest-v3/src/background/reporting

1 file changed

+25
-10
lines changed

extension-manifest-v3/src/background/reporting/index.js

+25-10
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,38 @@ function platformSpecificSettings() {
8686
};
8787
}
8888

89+
if (
90+
navigator.userAgent.includes('Opera') ||
91+
navigator.userAgent.includes('OPR') ||
92+
navigator.userAgent.includes('YaBrowser') // same release channel as Opera
93+
) {
94+
return {
95+
ALLOWED_COUNTRY_CODES: [
96+
'us',
97+
'de',
98+
'ru',
99+
'fr',
100+
'pl',
101+
'gb',
102+
'br',
103+
'ca',
104+
'ua',
105+
'nl',
106+
'es',
107+
],
108+
PATTERNS_URL: 'https://cdn2.ghostery.com/wtm-opera-desktop/patterns.json',
109+
CHANNEL: 'opera',
110+
};
111+
}
112+
89113
console.warn(
90114
'No matching config found. Falling back to patterns from Chrome Desktop.',
91115
);
92-
const settings = {
116+
return {
93117
ALLOWED_COUNTRY_CODES: ['us', 'de', 'fr'],
94118
PATTERNS_URL: 'https://cdn2.ghostery.com/wtm-chrome-desktop/patterns.json',
95119
CHANNEL: 'ghostery',
96120
};
97-
98-
if (
99-
navigator.userAgent.includes('Opera') &&
100-
navigator.userAgent.includes('YaBrowser') // same release channel as Opera
101-
) {
102-
settings.CHANNEL = 'opera';
103-
}
104-
105-
return settings;
106121
}
107122

108123
const COLLECTOR_DIRECT_URL = 'https://anonymous-communication.ghostery.net';

0 commit comments

Comments
 (0)