diff --git a/src/general.ts b/src/general.ts index 03c860a..c352498 100644 --- a/src/general.ts +++ b/src/general.ts @@ -71,8 +71,16 @@ async function getOEmbedRich($: cheerio.CheerioAPI, pageUrl: string): Promise s); + const safeList = [ + 'autoplay', + 'clipboard-write', + 'fullscreen', + 'encrypted-media', + 'picture-in-picture' + ]; if (allowedFeatures.some(allow => !safeList.includes(allow))) { // This iframe is probably too powerful to be embedded return null; diff --git a/test/oembed/invalid/oembed-too-powerful2.json b/test/oembed/invalid/oembed-too-powerful2.json index c0952dc..312b0e2 100644 --- a/test/oembed/invalid/oembed-too-powerful2.json +++ b/test/oembed/invalid/oembed-too-powerful2.json @@ -1,6 +1,6 @@ { "version": "1.0", "type": "rich", - "html": "", + "html": "", "height": 300 } diff --git a/test/oembed/oembed-allow-safelisted-features.json b/test/oembed/oembed-allow-safelisted-features.json index 8d41ff0..6ef40a1 100644 --- a/test/oembed/oembed-allow-safelisted-features.json +++ b/test/oembed/oembed-allow-safelisted-features.json @@ -1,6 +1,6 @@ { "version": "1.0", "type": "rich", - "html": "", + "html": "", "height": 300 }