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

fix(safari): Resolve manifest upgrade compatibility issues #391

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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
Loading