feat: add support for overriding OneSignal script src #202
Conversation
f02d415 to
0460a81
Compare
|
@claude review this PR |
|
Claude finished @sherwinski's task in 1m 13s —— View job PR Review
SummaryThis PR adds a ObservationsBehavior change: script loading is deferred to Previously, Duplicate script guard ( if (document.getElementById(ONESIGNAL_SDK_ID)) {
return;
}Good defensive addition. This correctly prevents double-injection if
Removed explanatory comments ( The PR removes these comments: // true if the script is successfully loaded from CDN.
// true if the script fails to load from CDN. A separate flag is necessary
// to disambiguate between a CDN load failure and a delayed call to
// OneSignal#init.The second comment in particular added useful context distinguishing JSDoc on /**
* Overrides the default OneSignal SDK script URL.
* Use this to self-host the SDK script on your own domain, e.g. to comply
* with strict Cross-Origin-Embedder-Policy (COEP) or Content-Security-Policy (CSP) headers.
* @default 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js'
*/
scriptSrc?: string;Good — the use-case motivation and VerdictLooks good overall. The feature is useful, implementation is clean, and the duplicate-guard is a nice bonus. The main things to keep in mind before merging:
|
|
🎉 This PR is included in version 3.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Features