Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chrome/src/agent/public-media-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function isDirectPublicMediaUrl(rawUrl) {
return hasPathId(path, /^\/[^/?#]+/);
}
if (hostMatches(host, 'pinterest.com')) return hasPathId(path, /^\/pin\/[^/?#]+/i);
if (hostMatches(host, 'linkedin.com')) return hasPathId(path, /^\/(?:posts\/|feed\/update\/)/i);
if (hostMatches(host, 'linkedin.com')) return hasPathId(path, /^\/(?:posts|feed\/update)\/[^/?#]+/i);
if (hostMatches(host, 'threads.net')) return hasPathId(path, /^\/@[^/]+\/post\/[^/?#]+/i);
if (hostMatches(host, 'facebook.com') || hostMatches(host, 'fb.com')) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/firefox/src/agent/public-media-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function isDirectPublicMediaUrl(rawUrl) {
return hasPathId(path, /^\/[^/?#]+/);
}
if (hostMatches(host, 'pinterest.com')) return hasPathId(path, /^\/pin\/[^/?#]+/i);
if (hostMatches(host, 'linkedin.com')) return hasPathId(path, /^\/(?:posts\/|feed\/update\/)/i);
if (hostMatches(host, 'linkedin.com')) return hasPathId(path, /^\/(?:posts|feed\/update)\/[^/?#]+/i);
if (hostMatches(host, 'threads.net')) return hasPathId(path, /^\/@[^/]+\/post\/[^/?#]+/i);
if (hostMatches(host, 'facebook.com') || hostMatches(host, 'fb.com')) {
return (
Expand Down
11 changes: 11 additions & 0 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10410,6 +10410,7 @@ test('public media recommendations carry immediate download_public_media fast pa
{ url: 'https://www.facebook.com/example/videos/123', title: 'Facebook video', media: { videoCount: 1, imageCount: 0 }, expectedKind: 'video' },
{ url: 'https://www.reddit.com/r/pics/comments/abc/photo/', title: 'A photo post', media: { imageCount: 1, videoCount: 0 }, expectedKind: 'image' },
{ url: 'https://www.linkedin.com/posts/example_123', title: 'LinkedIn public post video', media: { videoCount: 1, imageCount: 0 }, expectedKind: 'video' },
{ url: 'https://www.linkedin.com/feed/update/urn:li:activity:123', title: 'LinkedIn public feed update', media: { videoCount: 1, imageCount: 0 }, expectedKind: 'video' },
{ url: 'https://threads.net/@user/post/abc', title: 'Threads photo', media: { imageCount: 1, videoCount: 0 }, expectedKind: 'image' },
];

Expand Down Expand Up @@ -10455,6 +10456,16 @@ test('public media recommendations carry immediate download_public_media fast pa
assert.deepEqual(feedAction?.runOptions?.args, { save: false }, 'feed screenshot should not save an extra file');
assert.ok(feedAction?.runOptions?.steps?.some((step) => /explicit permalink/.test(step)), 'feed plan should pin explicit permalink resolution');

for (const url of ['https://www.linkedin.com/posts/', 'https://www.linkedin.com/feed/update/']) {
const linkedinFeedAction = buildRecommendedActions({
url,
title: 'LinkedIn',
media: { videoCount: 1, imageCount: 0 },
}).find((a) => a.id === 'download-media');
assert.equal(linkedinFeedAction?.runOptions?.firstTool, 'screenshot', `empty LinkedIn permalink should resolve a visible target first for ${url}`);
assert.match(linkedinFeedAction?.prompt || '', /exact public post\/reel URL/i, `empty LinkedIn permalink should require an explicit target for ${url}`);
}

const mobileFeedAction = buildRecommendedActions({
url: 'https://m.twitter.com/home',
title: 'Twitter Home',
Expand Down
Loading