mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-29 09:27:16 +09:00
more safelisted features
This commit is contained in:
parent
a5a8c4437d
commit
5153305bdd
@ -72,7 +72,14 @@ async function getOEmbedRich($: cheerio.CheerioAPI, pageUrl: string): Promise<OE
|
||||
}
|
||||
|
||||
const allowedFeatures = (iframe.attr('allow') ?? '').split(/\s+/g);
|
||||
const safeList = ['', 'fullscreen', 'encrypted-media', 'picture-in-picture'];
|
||||
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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"type": "rich",
|
||||
"html": "<iframe src='https://example.com/' allow='fullscreen encrypted-media picture-in-picture'></iframe>",
|
||||
"html": "<iframe src='https://example.com/' allow='autoplay clipboard-write fullscreen encrypted-media picture-in-picture'></iframe>",
|
||||
"height": 300
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user