diff --git a/AGENTS.md b/AGENTS.md index b639a39..360b967 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -968,8 +968,10 @@ element, and the element acts. That relay is why `frame-document.ts` has a `mess never promised. `pack` is `@missing-elements/h5p-libraries` on jsDelivr at `LIBRARY_PACK_VERSION` (its parts under `LIBRARY_PACK_BASE` since 2026-10-18, next invariant but two), which `sync-h5p-assets` stamps from `packages/libraries/package.json`; - `hub` is read as `pack` with one console note (`parseLibrarySources`), and `pack hub` is not - tried twice. Pinned rather than `@0`, so a player release always plays against the same + `hub` was read as `pack`, with a console note, from 0.6 to 0.10, and went before 1.0 + (2026-10-18, #44): an alias kept would have had to stay through 1.x, and a page still writing it + now fails on the address `hub`, named in the error, rather than playing something it did not + name. Pinned rather than `@0`, so a player release always plays against the same libraries, and `check-library-pack.mjs` in the player's `prepublishOnly` refuses a version not on npm, or one whose `parts/index.json` on jsDelivr is not this checkout's: the weekly refresh (`.github/workflows/libraries.yml`) bumps the pack on a branch and stamps the player — version @@ -2028,8 +2030,8 @@ SPA-fallback trap described above cannot happen there. turns the default `connect-src 'self' https:` into exactly the hosts given, and `config.js` hands the same list to the page, which refuses an `src` or a library URL off it by name before fetching anything. (Until 2026-10-10 it also refused `hub` unless `https://api.h5p.org` - was listed; `hub` now means `pack`, and a site without its own pack needs - `https://cdn.jsdelivr.net` listed for it.) The page checks only the address it is + was listed; a site without its own pack needs `https://cdn.jsdelivr.net` listed for `pack`, and + `hub`, which meant `pack` from then to embed 0.8, is no longer a token.) The page checks only the address it is given; `connect-src` also applies to every redirect, so a listed host that redirects off the list fails as a plain network error — the README says to list every host on the way. With a list, a listed host plays as it is, never untrusted: the host vouched for it when it wrote the site. Without one, a package @@ -2514,8 +2516,8 @@ deliberate additions to it, not drift: it; the GPL on the H5P core made that `(MIT AND GPL-3.0-only)`, and from 0.5 the runtime and the frame's boot script are `@missing-elements/h5p-runtime` so the player can be MIT alone. - A published library bundle, and `libraries` as an ordered list. The design has `hub` or one - URL; the hub's move put a bundle the project controls first, and since 0.6 `hub` means that - bundle and the hub is not asked at all. Since 0.10 the pack is split, a package downloads only + URL; the hub's move put a bundle the project controls first, and since 0.6 the hub is not asked + at all (`hub` meant the pack until it went before 1.0). Since 0.10 the pack is split, a package downloads only the parts it needs, and the pack's newer versions play in place of the older ones a package carries: the design plays what a package carries. - Content written for an older minor than the one served is upgraded in the frame with the diff --git a/README.md b/README.md index 2c4de02..dd0719a 100644 --- a/README.md +++ b/README.md @@ -179,11 +179,11 @@ allows one Service Worker, or must work offline, mounts the player in its own wo | `jobs` | attribute | The background worker's URL, for a CSP without `blob:` in `worker-src`. Default: `blob:`, then `h5p-jobs.js` beside the element | | `runtime` | property | The `runtime` export of `@missing-elements/h5p-runtime`. Set before `src` | | `assets-base` | attribute | Where the runtime's `dist/` is served. Default: `frame-assets/` beside the element | -| `libraries` | attribute | Sources for a package's libraries, tried in order: `pack`, the library pack, of which only the libraries a package needs are downloaded, and whose newer versions play in place of those a package carries; a `.h5p` URL, which only fills gaps; or both. `hub` means `pack`. Default: a package plays as it is, and one without its libraries is refused | +| `libraries` | attribute | Sources for a package's libraries, tried in order: `pack`, the library pack, of which only the libraries a package needs are downloaded, and whose newer versions play in place of those a package carries; a `.h5p` URL, which only fills gaps; or both. Default: a package plays as it is, and one without its libraries is refused | | `pack-base` | attribute | Where `pack` is: the folder of a copy of `@missing-elements/h5p-libraries`' `parts/` on your site. Default: jsDelivr, at the version this release pins | | `pack` | property | The `pack` export of `@missing-elements/h5p-libraries`, as a bundler emits it; wins over `pack-base`. Set before `src` | | `refresh-libraries` | attribute | `off` plays the libraries a package carries as exported, and `pack` only fills gaps. Default: the pack's newer versions play | -| `untrusted` | attribute, property | Plays a package you did not make as data: its own library folders are ignored and the libraries come from `libraries` (default `pack`), `content/` serves only H5P's own file types, and the frame's script policy names exact paths. Its content is checked against each library's `semantics.json`, as the H5P CMS plugins check it. A package that needs its own copy of a library is refused, with `missingLibraries.carried` set. Needs the runtime at 0.2 or later | +| `untrusted` | attribute, property | Plays a package you did not make as data: its own library folders are ignored and the libraries come from `libraries` (default `pack`), `content/` serves only H5P's own file types, and the frame's script policy names exact paths. Its content is checked against each library's `semantics.json`, as the H5P CMS plugins check it. A package that needs its own copy of a library is refused, with `missingLibraries.carried` set | | `allow-origins` | attribute | Extra origins for the frame's CSP, space separated | | `frame`, `copyright`, `export`, `icon`, `embed` | attribute | Show the H5P action bar and its buttons. `export` needs `download-url` or a package URL, `embed` needs `embed-code` | | `fullscreen` | attribute | `off` removes the fullscreen button | @@ -196,7 +196,7 @@ allows one Service Worker, or must work offline, mounts the player in its own wo | `auto-resize` | attribute | `off` to size the element yourself. Default: follows the content's height | | `preload` | attribute, property | `auto` pulls large deflated media before it is asked for. Default: `none` | | `resume` | attribute, property | `device` keeps the content's saved state on this device; `host` hands it to the page. Default: `off` | -| `save-interval` | attribute, property | Seconds between saves while the content runs, with `resume`; also saved after each completion and as the page closes. Default: `10` | +| `save-interval` | attribute, property (`saveInterval`) | Seconds between saves while the content runs, with `resume`; also saved after each completion and as the page closes. Default: `10` | | `userData` | property | Under `resume="host"`, the state to restore, as `userdata` events carried it. Set before `src`. Not checked against the build: compare the `revision` you stored | | `state` | read-only | `idle`, `probing`, `downloading`, `indexing`, `ready` or `error` | | `pkgId`, `revision` | read-only | The loaded package's id and build fingerprint | diff --git a/apps/demo/demo/setup.html b/apps/demo/demo/setup.html index fe91391..5b46bff 100644 --- a/apps/demo/demo/setup.html +++ b/apps/demo/demo/setup.html @@ -287,11 +287,11 @@
jobsblob: workers: copy dist/h5p-jobs.js beside h5p-sw.js and point this at it. Default: a blob: URL, then h5p-jobs.js next to the element. Must be same-origin.runtimeruntime export of @missing-elements/h5p-runtime, for a bundler to emit the files. Set it before src; it wins over assets-base.assets-basedist/ is served from. Default: frame-assets/ next to the element. May be a CDN.librariespack for @missing-elements/h5p-libraries, every H5P hub content type's libraries, one archive per library, of which only those a package needs are downloaded, from jsDelivr, and whose newer versions play in place of those a package carries; or the URL of a .h5p that carries library folders, which only fills gaps; or several separated by spaces, tried in order. hub means pack. Downloaded once and cached. Default: a package plays as it is, and one without its libraries is refused, with the missing libraries named.librariespack for @missing-elements/h5p-libraries, every H5P hub content type's libraries, one archive per library, of which only those a package needs are downloaded, from jsDelivr, and whose newer versions play in place of those a package carries; or the URL of a .h5p that carries library folders, which only fills gaps; or several separated by spaces, tried in order. Downloaded once and cached. Default: a package plays as it is, and one without its libraries is refused, with the missing libraries named.pack-baseparts/, with its libraries.txt of licences beside it, for pack to come from instead of jsDelivr. With a bundler, set the pack property to the package's pack export instead.refresh-librariesoff plays the libraries a package carries as exported; pack then only fills gaps.preloadauto pulls large compressed media once the content is up, instead of when the learner presses play.untrustedlibraries, pack when that is not set; content/ serves only H5P's own file types; the frame's script policy names exact paths instead of your origin; the content is checked against each library's semantics.json, as the H5P CMS plugins check it. A package that needs its own copy of a library is refused, and the error's missingLibraries.carried says so. Needs the runtime at 0.2 or later.untrustedlibraries, pack when that is not set; content/ serves only H5P's own file types; the frame's script policy names exact paths instead of your origin; the content is checked against each library's semantics.json, as the H5P CMS plugins check it. A package that needs its own copy of a library is refused, and the error's missingLibraries.carried says so.allow-originsresumehost keeps nothing on the device: the page gets a userdata event on every save and hands the state back through userData before the next load. Default: off, nothing is kept. Nothing is sent in either case.save-intervalresume. The content is also saved shortly after each completion and as the page closes. Default: 10; the H5P plugins use 30, which suits a host that sends each save to a server.