Skip to content

Conversation

@diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Nov 27, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1206580121312550/task/1212218453244516?focus=true

Description

Testing Steps

N/A - feature not available in any platform yet.

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Introduces a Notification API polyfill that bridges to native for permissions/events, with new messaging schemas/types and comprehensive integration tests.

  • WebCompat feature (injected/src/features/web-compat.js):
    • Web Notifications polyfill: Replaces window.Notification in secure contexts with constructor, permission getter (default/denied), maxActions, requestPermission, and event handlers (onshow, onclose, onclick, onerror).
      • Bridges to native via notify('showNotification' | 'closeNotification'), request('requestPermission'), and subscribe('notificationEvent').
      • Tracks notifications via an internal map; ensures close() fires onclose once; supports nativeEnabled: false to short-circuit to denied without native calls.
    • Adds wrapFunction usage and internal storage for notifications.
  • Messaging schemas (injected/src/messages/web-compat/*.json):
    • Add showNotification.notify, closeNotification.notify, requestPermission.request/response, and notificationEvent.subscribe message definitions.
  • Types (injected/src/types/web-compat.ts):
    • Extend WebCompatMessages with new notifications/requests/subscriptions.
    • Augment WebCompat interface to include notify and subscribe.
  • Tests (injected/integration-test/web-compat.spec.js):
    • Add webNotifications suites covering API exposure, permission flow updates, native error fallback, event handling, toString shapes, message emission, and behavior when nativeEnabled: false.

Written by Cursor Bugbot for commit a5993e5. This will update automatically on new commits. Configure here.

- Add web-notifications.js feature with Notification API polyfill
- Add message schema for showNotification, closeNotification, requestPermission
- Add unit tests
- Register feature for apple platform
- Add debug logging for feature loading
- Convert title, body, icon, tag to String() in constructor
- Add tests for non-string option coercion
- Ensures Swift Decodable can parse numeric tag values
@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit a5993e5
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/692d781b0e39c100082f9b9c
😎 Deploy Preview https://deploy-preview-2067--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

[Beta] Generated file diff

Time updated: Mon, 01 Dec 2025 11:13:22 GMT

Android
    - android/adsjsContentScope.js
  • android/contentScope.js

File has changed

Apple
    - apple/contentScope.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

@diegoreymendez diegoreymendez changed the title Diego/support website notifications Add webNotifications support Nov 28, 2025
@diegoreymendez diegoreymendez changed the title Add webNotifications support Add Web Notifications support Nov 28, 2025
diegoreymendez and others added 4 commits November 28, 2025 16:55
- Add webNotificationsFix() to web-compat.js as independent setting
- Move message definitions from web-notifications/ to web-compat/
- Remove webNotifications from standalone feature registration
- Delete standalone web-notifications.js and types
- Replace unit tests with integration tests in web-compat.spec.js
- Regenerate web-compat.ts types for new messages
- Add isSecureContext check (crypto.randomUUID requires secure context)
- Add nativeEnabled setting (defaults true, when false returns denied and skips native calls)
- Add integration tests for nativeEnabled: false behavior
@diegoreymendez diegoreymendez marked this pull request as ready for review November 28, 2025 16:36
@diegoreymendez diegoreymendez requested a review from a team as a code owner November 28, 2025 16:36
- Update secure context comment to clarify Notification API requirement
- Replace wrapToString with shimInterface for consistent constructor wrapping
shimInterface requires full interface implementation including EventTarget,
which is impractical for the Notification polyfill. Reverting to wrapToString.
@diegoreymendez diegoreymendez added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit bd12a7b Dec 1, 2025
19 checks passed
@diegoreymendez diegoreymendez deleted the diego/support-website-notifications branch December 1, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants