mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-17 03:27:27 +09:00
built
This commit is contained in:
parent
51148cea27
commit
883baf437a
@ -58,8 +58,16 @@ async function getOEmbedRich($, pageUrl) {
|
|||||||
// No proper size info
|
// No proper size info
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const allowedFeatures = (iframe.attr('allow') ?? '').split(/\s+/g);
|
// TODO: This implementation only allows basic syntax of `allow`.
|
||||||
const safeList = ['', 'fullscreen', 'encrypted-media', 'picture-in-picture'];
|
// Might need to implement better later.
|
||||||
|
const allowedFeatures = (iframe.attr('allow') ?? '').split(/\s*;\s*/g).filter(s => s);
|
||||||
|
const safeList = [
|
||||||
|
'autoplay',
|
||||||
|
'clipboard-write',
|
||||||
|
'fullscreen',
|
||||||
|
'encrypted-media',
|
||||||
|
'picture-in-picture'
|
||||||
|
];
|
||||||
if (allowedFeatures.some(allow => !safeList.includes(allow))) {
|
if (allowedFeatures.some(allow => !safeList.includes(allow))) {
|
||||||
// This iframe is probably too powerful to be embedded
|
// This iframe is probably too powerful to be embedded
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user