Chat+ link previews: a link in a chat shows its page's title, text and picture, YouTube playable in place
X's web chat shows a link as a bare card. An X tab on a chat page may now ask native code (link_preview, x-capture only, chat pages only) for one link's preview. Native code fetches it: https and public hosts only (addresses checked and pinned), never X's hosts, no cookies or referrer, redirects re-checked, page head <= 512 KB, images <= 1.5 MB by magic bytes as data:, 30 fetches a minute, memory-only cache. Only the link leaves the page. On by default (owner, 2026-10-10).
This commit is contained in:
parent
89c9bfc75f
commit
c03f1a989b
21 changed files with 1455 additions and 519 deletions
|
|
@ -61,11 +61,11 @@ const pace = (chat: FakeChat) => ({ sleep: (ms: number) => new Promise<void>(res
|
|||
const star = (row: El) => row.querySelector('.bt-chat-star')!;
|
||||
const group = (chat: FakeChat) => chat.conversations.get(GROUP)!.history;
|
||||
|
||||
test('Chat+: five features, each its own flag, all off by default, all allowed on X\'s chat pages', () => {
|
||||
assert.deepEqual(FEATURES.map(feature => feature.id), ['chat.bookmarks', 'chat.searchLoaded', 'chat.pins', 'chat.personFilter', 'chat.keywords']);
|
||||
test('Chat+: six features, each its own flag, off by default but link previews (owner, 2026-10-10), all allowed on X\'s chat pages', () => {
|
||||
assert.deepEqual(FEATURES.map(feature => feature.id), ['chat.bookmarks', 'chat.searchLoaded', 'chat.pins', 'chat.personFilter', 'chat.linkPreviews', 'chat.keywords']);
|
||||
assert.deepEqual(MODULES.map(module => module.id).sort(), FEATURES.map(feature => feature.id).sort());
|
||||
for (const feature of FEATURES) {
|
||||
assert.equal(feature.default, false, feature.id);
|
||||
assert.equal(feature.default, feature.id === 'chat.linkPreviews', feature.id);
|
||||
assert.equal(feature.heavy, true, `${feature.id} runs on the heavy chat pages`);
|
||||
assert.ok(feature.permissions && !feature.permissions.includes('network'), `${feature.id}: no network`);
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ test('starred messages: stored in full, valid ones only, each once; the list fil
|
|||
});
|
||||
|
||||
test('Starred messages: a star on every rendered row; a click stores exactly that message, in full; off leaves nothing', () => {
|
||||
const { env, chat, stored } = page(`/i/chat/${GROUP}`, { 'chat.bookmarks': true });
|
||||
const { env, chat, stored } = page(`/i/chat/${GROUP}`, { 'chat.bookmarks': true, 'chat.linkPreviews': false });
|
||||
assert.deepEqual(env.registry.active(), ['chat.bookmarks']);
|
||||
const all = group(chat);
|
||||
const rows = chat.rendered();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue