Skip to content

Commit

Permalink
Libs: fix Ghostery browser detection
Browse files Browse the repository at this point in the history
fix #957
  • Loading branch information
chrmod authored and philipp-classen committed Dec 13, 2022
1 parent 9f5abdc commit 898f8d5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libs/src/browser-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ const getVersion = () => {
};

const getBrowserInfo = async () => {
const BROWSER_INFO = {};
const BROWSER_INFO = {
displayName: '',
name: '',
token: '',
os: '',
version: '',
};

// Set name and token properties. CMP uses `name` value. Metrics uses `token`
const browser = getBrowser();
Expand Down Expand Up @@ -143,6 +149,9 @@ cachedGetBrowserInfo.isFirefox = isFirefox;
cachedGetBrowserInfo.isEdge = isEdge;
cachedGetBrowserInfo.isGhosteryBrowser = async () => {
const browserInfo = await cachedGetBrowserInfo();
if (!browserInfo.name) {
return false;
}
return browserInfo.name.includes('ghostery');
};

Expand Down

0 comments on commit 898f8d5

Please sign in to comment.