diff --git a/CHANGES.md b/CHANGES.md index 434b19f2..2a85cf93 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,10 +11,10 @@ Changes: - None yet Fixes: - - None yet + - Disables notifications in Safari due to API limitations ([391](https://github.com/freelawproject/recap-chrome/pull/391)). For developers: - - Nothing yet + - Preserves permissions during macOS and iOS release package creation ([391](https://github.com/freelawproject/recap-chrome/pull/391)) ## 2.8.0 (2024-08-27) diff --git a/safari/build-safari.py b/safari/build-safari.py index 626c61f4..bd9929c2 100644 --- a/safari/build-safari.py +++ b/safari/build-safari.py @@ -44,14 +44,6 @@ def update_manifest_files(operating_system: str) -> None: f"cd {operating_system}/Recap && xcrun agvtool new-marketing-version {manifest['version']}" ) - manifest["permissions"] = [ - "*://*.uscourts.gov/", - "notifications", - "storage", - "unlimitedStorage", - "activeTab", - "cookies", - ] # The main difference between iOS and macOS is the permissions. if operating_system == "iOS": manifest["background"]["persistent"] = False diff --git a/src/utils/background_notifier.js b/src/utils/background_notifier.js index bb2f434a..7fe9356d 100644 --- a/src/utils/background_notifier.js +++ b/src/utils/background_notifier.js @@ -29,6 +29,12 @@ const showNotification = function (title, message, cb) { console.info( 'RECAP: Running showNotification function. Expect a notification.' ); + // Avoid triggering notifications for Safari because the API is not supported + if ( + /Safari/.test(navigator.userAgent) && + !/Chrome|Chromium/.test(navigator.userAgent) + ) + return; chrome.notifications.create(id, notificationOptions(title, message)); // Make it go away when clicked. chrome.notifications.onClicked.addListener((id) =>