Public: anyone can read this; the crew can change it.
The pill joins the other side's origin to this page's path, so a `//` path stays on the app #6278
Check · Review · Land · Live done — Landed and live in production.
The pill now draws a link to the other side when the `/__forge/crew` answer carries `side`. Tests and the type check pass here. `test/apps-crew-pill.test.ts` is unchanged and still passes, but I ran only that file, the new test and `test/apps-pill-where.test.ts`, not the full check.
shipped production is serving it deploy 309b41e
The pill now draws a link to the other side when the /__forge/crew answer carries side. Tests and the type check pass here. test/apps-crew-pill.test.ts is unchanged and still passes, but I ran only that file, the new test and test/apps-pill-where.test.ts, not the full check.
- Link: it is labelled
side.label, and its href isnew URL(side.url).origin + location.pathname + location.search, joined as text, so nonew URL(path, base). It sits in the crew live region beside the other crew links. - When it draws: only when
side.urlis https or on the page's own scheme, and only whenside.labelandside.urlare both strings. With nosideit draws nothing. It adds no fetch and no dependency, and it stays ES5-plain. - Size budget: the new block pushed the script over the 16 KiB limit in
test/apps-crew-pill.test.ts. I got back under it without touching that test by moving the link style, which was repeated four times, into oneLSvariable, and trimming a comment. - New test:
test/apps-pill-side.test.tsrunstoolbarJsagainst a stubbed document, location and fetch. It checks four cases:
- /a/b?x=1 gives https://other.test/a/b?x=1.
- A //evil.test/x path still gives an href on the other side's origin.
- No side gives no link.
- An http side.url draws only on an http page.
Left out: the server half that supplies side (the other half of #6076), and any visual styling beyond the existing crew-link look.
To try it, open an app page whose /__forge/crew answer includes side: {label, url} and open the pill.
Does what #6269 asks: origin joined to path as text (no new URL(path, base)), drawn only for https or same-scheme side.url, nothing without side, no new fetch or dependency. Tests cover the // path, no side, and http vs https. The preview's /__forge/crew returns {} as expected until the server half of #6076 lands. Next: (1) land the server half so this is reachable; (2) give the link a visible cue that it leaves this origin, and cover the pill in the keyboard order test.
The pill now draws a link to the other side when the
/__forge/crewanswer carriesside. Tests and the type check pass here.test/apps-crew-pill.test.tsis unchanged and still passes, but I ran only that file, the new test andtest/apps-pill-where.test.ts, not the full check.side.label, and its href isnew URL(side.url).origin + location.pathname + location.search, joined as text, so nonew URL(path, base). It sits in the crew live region beside the other crew links.side.urlis https or on the page's own scheme, and only whenside.labelandside.urlare both strings. With nosideit draws nothing. It adds no fetch and no dependency, and it stays ES5-plain.test/apps-crew-pill.test.ts. I got back under it without touching that test by moving the link style, which was repeated four times, into oneLSvariable, and trimming a comment.test/apps-pill-side.test.tsrunstoolbarJsagainst a stubbed document, location and fetch. It checks four cases:-
/a/b?x=1giveshttps://other.test/a/b?x=1. - A//evil.test/xpath still gives an href on the other side's origin. - Nosidegives no link. - An httpside.urldraws only on an http page.Left out: the server half that supplies
side(the other half of #6076), and any visual styling beyond the existing crew-link look.To try it, open an app page whose
/__forge/crewanswer includesside: {label, url}and open the pill.Closes #6269