feat: sync Rokt kit with upstream v1.32.0 - #1327
Conversation
Ports upstream commit c13e719 from mparticle-javascript-integration-rokt v1.32.0. generateBaseUrl now treats a domain that already carries a scheme (:// prefix) as a full origin and uses it verbatim (trailing slashes trimmed), so partners can set mp.Rokt.domain to chrome-extension://<id>/rokt and the kit loads launcher.js from the bundled extension. Bare-host CNAMEs keep the https:// default. generateReportingUrl falls back to the default API domain for non-http(s) schemes so reporting and logging endpoints are not sent to a chrome-extension:// or http:// origin. sendAdBlockMeasurementSignals skips the ad-block probe for non-https scheme-bearing domains (extension / local). The probe URL now uses generateBaseUrl so a full https origin is used verbatim instead of being double-prefixed.
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 623c952. Bugbot is set up for automated code reviews on this repo. Configure here. |
|




Summary
Applies the same change as mparticle-integrations/mparticle-javascript-integration-rokt#115 to the in-repo copy of the Rokt kit.
generateBaseUrlnow treats a domain that already carries a scheme (://) as a full origin and uses it verbatim (trailing slashes trimmed). Partners can setmp.Rokt.domaintochrome-extension://<id>/roktand the kit loadslauncher.jsfrom the bundled extension. Bare-host CNAMEs keep thehttps://default.generateReportingUrlfalls back to the default API domain for non-http(s) schemes so reporting/logging endpoints are not routed to achrome-extension://orhttp://origin.sendAdBlockMeasurementSignalsskips the ad-block probe for non-https scheme-bearing domains. The probe URL now usesgenerateBaseUrlso a fullhttps://origin is used verbatim instead of being double-prefixed (https://https://...).Test plan
generateLauncherScript('chrome-extension://abcdef123/rokt')→chrome-extension://abcdef123/rokt/wsdk/integrations/launcher.jsgenerateLauncherScript('chrome-extension://abcdef123/rokt/')trims trailing slashgenerateLauncherScript('http://localhost:8001')→http://localhost:8001/wsdk/integrations/launcher.jsgenerateThankYouElementScript('chrome-extension://abcdef123/rokt')→ verbatim originsendAdBlockMeasurementSignals('https://custom.rokt.com', ...)still fires the probesendAdBlockMeasurementSignals('chrome-extension://abcdef123/rokt', ...)skips the probeErrorReportingServicewithintegrationDomain: 'https://custom.rokt.com'posts to that originErrorReportingServicewithintegrationDomain: 'chrome-extension://...'falls back to default API domain