Skip to content

feat: sync Rokt kit with upstream v1.32.0 - #1327

Open
alexs-mparticle wants to merge 1 commit into
mainfrom
main-v3
Open

feat: sync Rokt kit with upstream v1.32.0#1327
alexs-mparticle wants to merge 1 commit into
mainfrom
main-v3

Conversation

@alexs-mparticle

Copy link
Copy Markdown
Collaborator

Summary

Applies the same change as mparticle-integrations/mparticle-javascript-integration-rokt#115 to the in-repo copy of the Rokt kit.

  • generateBaseUrl now treats a domain that already carries a scheme (://) as a full origin and uses it verbatim (trailing slashes trimmed). 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/logging endpoints are not routed to a chrome-extension:// or http:// origin.
  • sendAdBlockMeasurementSignals skips the ad-block probe for non-https scheme-bearing domains. The probe URL now uses generateBaseUrl so a full https:// 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.js
  • generateLauncherScript('chrome-extension://abcdef123/rokt/') trims trailing slash
  • generateLauncherScript('http://localhost:8001')http://localhost:8001/wsdk/integrations/launcher.js
  • generateThankYouElementScript('chrome-extension://abcdef123/rokt') → verbatim origin
  • sendAdBlockMeasurementSignals('https://custom.rokt.com', ...) still fires the probe
  • sendAdBlockMeasurementSignals('chrome-extension://abcdef123/rokt', ...) skips the probe
  • ErrorReportingService with integrationDomain: 'https://custom.rokt.com' posts to that origin
  • ErrorReportingService with integrationDomain: 'chrome-extension://...' falls back to default API domain
  • CI green

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.
@alexs-mparticle
alexs-mparticle requested a review from a team as a code owner August 18, 2026 17:10
@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes URL resolution for script load, reporting, and ad-block probes; misconfiguration could break launcher load or misroute telemetry, though behavior for standard https hostnames is preserved.

Overview
Syncs the in-repo Rokt kit to upstream v1.32.0 and updates how mp.Rokt.domain is turned into URLs so partners can point the kit at chrome-extension (or other full origins) for bundled launcher assets.

generateBaseUrl now treats any value containing :// as a complete origin (trailing slashes stripped) instead of always prefixing https://. Bare hostnames still get the default https:// behavior.

generateReportingUrl ignores non-http/https integration domains when building log/error endpoints, so reporting keeps using the default API host instead of a chrome-extension:// (or similar) origin.

sendAdBlockMeasurementSignals skips the ad-block probe when the domain is scheme-bearing but not https://, and builds the probe base URL via generateBaseUrl so full https:// origins are not double-prefixed.

Reviewed by Cursor Bugbot for commit 623c952. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant