Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

(embed) sandbox the iframe

Rigel Kent775403464132
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts
index b7cd40aa28..18a6b4dfa4 100644
--- a/client/src/assets/player/utils.ts
+++ b/client/src/assets/player/utils.ts
@@ -92,6 +92,7 @@ function buildVideoLink (time?: number) {
function buildVideoEmbed (embedUrl: string) {
return '<iframe width="560" height="315" ' +
+ 'sandbox="allow-same-origin allow-scripts" ' +
'src="' + embedUrl + '" ' +
'frameborder="0" allowfullscreen>' +
'</iframe>'
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index a58a5b8cf2..1f82db9c40 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -45,7 +45,7 @@ function generateOEmbed (req: express.Request, res: express.Response, next: expr
thumbnailUrl = undefined
}
- const html = `<iframe width="${embedWidth}" height="${embedHeight}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>`
+ const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>`
const json: any = {
type: 'video',