diff --git a/src/common/yt.ts b/src/common/yt.ts index be806e6..9ee3e53 100644 --- a/src/common/yt.ts +++ b/src/common/yt.ts @@ -89,7 +89,7 @@ export const ytService = { video_ids: groups['video']?.map(s => s.id).join(','), channel_ids: groups['channel']?.map(s => s.id).join(','), })); - return fetch(`${LBRY_API_HOST}/yt/resolve?${params}`) + return fetch(`${LBRY_API_HOST}/yt/resolve?${params}`, {cache: 'force-cache'}) .then(rsp => rsp.ok ? rsp.json() : null); })); diff --git a/src/scripts/ytContent.tsx b/src/scripts/ytContent.tsx index 3d65f95..ecd8dd9 100644 --- a/src/scripts/ytContent.tsx +++ b/src/scripts/ytContent.tsx @@ -106,3 +106,8 @@ chrome.runtime.onMessage.addListener(async (req: { url: string }) => { if (!req.url) return; handle(new URL(req.url)); }); + +chrome.storage.onChanged.addListener((changes, areaName) => { + if (areaName !== 'local' || !changes.redirect) return; + handle(new URL(location.href)) +});