Skip to content

Commit

Permalink
Merge pull request #391 from freelawproject/fix-safari-compatibility-…
Browse files Browse the repository at this point in the history
…issues

fix(safari): Resolve manifest upgrade compatibility issues
  • Loading branch information
ERosendo authored Aug 30, 2024
2 parents 3ebcd1d + 0e4117e commit 6592874
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 0 additions & 8 deletions safari/build-safari.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/utils/background_notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down

0 comments on commit 6592874

Please sign in to comment.