Skip to content

Document the Prebid.js CDN bundle loader (bundle.js) - #6826

Merged
patmmccann merged 4 commits into
prebid:masterfrom
patmmccann:docs-cdn-bundle
Oct 28, 2026
Merged

patmmccann merged 4 commits into
prebid:masterfrom
patmmccann:docs-cdn-bundle

Conversation

@patmmccann

Copy link
Copy Markdown
Collaborator

Documents the CDN-based loader added in prebid/Prebid.js#15329 (Prebid.js 11.40.0).

  • Adds "Option 3: Load from the jsDelivr CDN" to the download page. It covers loading Prebid.js with https://cdn.jsdelivr.net/npm/prebid.js@<version>/dist/bundle.js?modules=..., and how the loader resolves and loads modules: checksummed manifest, dependency resolution, SRI script tags, storageControl metadata. It also documents the modules / globalVarName / distUrlBase query parameters and the two error cases.
  • Briefly explains the crossoriginstorage attribute (WICG Cross-Origin Storage proposal; ignored by browsers that don't support it).
  • Notes the CSP/CORS requirements, version pinning, and the prebid.web.js drop-in build output (dist/not-for-prod/ on npm; tagged builds only).
  • Closes Option 2's bs-docs-section div, which was never closed.
  • Adds a cross-link from "Loading modules separately" in the modules index.

🤖 Generated with Claude Code

Add an "Option 3: Load from the jsDelivr CDN" section to the download
page describing bundle.js (Prebid.js 11.40.0+, prebid/Prebid.js#15329):
usage, query parameters, loading behavior, errors, Cross-Origin Storage,
CSP notes and prebid.web.js. Cross-link it from "Loading modules
separately" in the modules index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T17:16:46.017766Z ace1d69 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for prebid-docs-preview ready!

Name Link
🔨 Latest commit 8d2bb78
🔍 Latest deploy log https://app.netlify.com/projects/prebid-docs-preview/deploys/6ae2596b55643ceebcf6c8a5
😎 Deploy Preview https://deploy-preview-6826--prebid-docs-preview.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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ace1d69d55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread download.md

### Notes

- Your Content Security Policy (if any) must allow scripts from `https://cdn.jsdelivr.net`, or from your `distUrlBase` host. Because files are loaded with `crossorigin="anonymous"` and an `integrity` check, a custom `distUrlBase` host must also send CORS headers (`Access-Control-Allow-Origin`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the manifest origin in connect-src guidance

On a site whose CSP has a restrictive connect-src (or a restrictive default-src fallback), whitelisting the CDN only for scripts as instructed here still blocks the manifest fetch described above before any module scripts are created. The guidance should require the distUrlBase origin in connect-src as well as script-src.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change: the manifest isn't fetched; it is loaded as a script (manifest.js?callback=... through the same script loader as the chunks, web-bundler/load.mjs), so only script-src is involved.

Comment thread download.md Outdated
1. Fetches the manifest for that release, which lists every module, its dependencies, and its checksum. The manifest itself is verified against a checksum built into `bundle.js`.
1. Works out which files are needed: `prebid-core`, the requested modules and their dependencies, plus the `.metadata.js` disclosure files if `storageControl` is one of the requested modules.
1. Adds a `<script>` tag for each file, with an `integrity` attribute set to the file's checksum.
1. Once all files have loaded, processes the `pbjs.que` command queue.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Tie the queue name to globalVarName

When globalVarName is set to anything other than pbjs (for example, foo), the loader processes foo.que, not the pbjs.que queue named here. A publisher following this description could enqueue setup on the unused default global, so describe this as the selected global's queue, with pbjs.que only as the default.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1bd1d03: now says it processes the command queue of the Prebid.js global (pbjs.que by default), matching window[globalVarName].processQueue() in web-bundler/load.mjs.

…edback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patmmccann
patmmccann merged commit f05b218 into prebid:master Oct 28, 2026
6 of 7 checks passed
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