Skip to content

Commit a704000

Browse files
committed
oembed: extract legacy allowfullscreen if it is missing in allow attribute
1 parent 7ec8268 commit a704000

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

plugins/links/oembed-rich.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export default {
110110
widget.rel = widget.rel.concat(iframe.allow.replace(/autoplay;?\s?\*?/ig, '').split(/\s?\*?(?:;|,)\s?\*?/g));
111111
}
112112

113+
if (iframe && iframe.allowfullscreen === '' && widget.rel.indexOf('fullscreen') === -1) { // ex.: Supademo
114+
widget.rel.push('fullscreen');
115+
}
116+
113117
if (iframe && iframe.src && iframe.onmousewheel === '') {
114118
widget.rel.push('nowheel');
115119
}

plugins/links/oembed-video.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export default {
6666
player.rel = player.rel.concat(iframe.allow.replace(/autoplay;?\s?\*?/ig, '').split(/\s?\*?(?:;|,)\s?\*?/g));
6767
}
6868

69+
if (iframe && iframe.allowfullscreen === '' && player.rel.indexOf('fullscreen') === -1) {
70+
player.rel.push('fullscreen');
71+
}
72+
6973
if (player.href && whitelistRecord.isAllowed('oembed.video', "accept") && player.type === CONFIG.T.text_html) {
7074
player.accept = player.type;
7175
delete player.type;

0 commit comments

Comments
 (0)