Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web 3309 patch - Fixed hardcoded feature identification with API check based logic #345

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions clevertap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clevertap.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clevertap.min.js

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions src/modules/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,15 @@ export default class NotificationHandler extends Array {
return
}

// right now, we only support Chrome V50 & higher & Firefox
if (isChrome()) {
const chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/)
if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }
} else if (isFirefox()) {
const firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/)
if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }
} else if (isSafari()) {
const safariAgent = navigator.userAgent.match(/Safari\/(\d+)/)
if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }
} else {
return
/*
If it is chrome or firefox and the nativeWebPush is not supported then return
For Safari the APNs route is open if nativeWebPush is not supported
*/
if (isChrome() || isFirefox()) {
if (!this.#isNativeWebPushSupported()) {
this.#logger.error('Web Push Notification is not supported on this browser')
return
}
}

// we check for the cookie in setUpChromeNotifications() the tokens may have changed
Expand Down
Loading