Repository navigation
Document the Prebid.js CDN bundle loader (bundle.js) - #6826
Conversation
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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
✅ Deploy Preview for prebid-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 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".
|
|
||
| ### 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`). |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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>
Documents the CDN-based loader added in prebid/Prebid.js#15329 (Prebid.js 11.40.0).
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 themodules/globalVarName/distUrlBasequery parameters and the two error cases.crossoriginstorageattribute (WICG Cross-Origin Storage proposal; ignored by browsers that don't support it).prebid.web.jsdrop-in build output (dist/not-for-prod/on npm; tagged builds only).bs-docs-sectiondiv, which was never closed.🤖 Generated with Claude Code