embed: allow embeds like YouTube to link back to its site

pull/3609/head
Mime Čuvalo 2024-04-25 12:15:29 +01:00
rodzic a319ad9497
commit d46d12c0f1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: BA84499022AC984D
3 zmienionych plików z 14 dodań i 14 usunięć

Wyświetl plik

@ -426,7 +426,7 @@ export const embedShapePermissionDefaults: {
readonly 'allow-modals': false;
readonly 'allow-orientation-lock': false;
readonly 'allow-pointer-lock': false;
readonly 'allow-popups-to-escape-sandbox': false;
readonly 'allow-popups-to-escape-sandbox': true;
readonly 'allow-popups': true;
readonly 'allow-presentation': false;
readonly 'allow-same-origin': true;

Wyświetl plik

@ -1915,7 +1915,7 @@
},
{
"kind": "Content",
"text": "{\n readonly 'allow-downloads-without-user-activation': false;\n readonly 'allow-downloads': false;\n readonly 'allow-forms': true;\n readonly 'allow-modals': false;\n readonly 'allow-orientation-lock': false;\n readonly 'allow-pointer-lock': false;\n readonly 'allow-popups-to-escape-sandbox': false;\n readonly 'allow-popups': true;\n readonly 'allow-presentation': false;\n readonly 'allow-same-origin': true;\n readonly 'allow-scripts': true;\n readonly 'allow-storage-access-by-user-activation': false;\n readonly 'allow-top-navigation-by-user-activation': false;\n readonly 'allow-top-navigation': false;\n}"
"text": "{\n readonly 'allow-downloads-without-user-activation': false;\n readonly 'allow-downloads': false;\n readonly 'allow-forms': true;\n readonly 'allow-modals': false;\n readonly 'allow-orientation-lock': false;\n readonly 'allow-pointer-lock': false;\n readonly 'allow-popups-to-escape-sandbox': true;\n readonly 'allow-popups': true;\n readonly 'allow-presentation': false;\n readonly 'allow-same-origin': true;\n readonly 'allow-scripts': true;\n readonly 'allow-storage-access-by-user-activation': false;\n readonly 'allow-top-navigation-by-user-activation': false;\n readonly 'allow-top-navigation': false;\n}"
}
],
"fileUrlPath": "packages/tlschema/src/shapes/TLEmbedShape.ts",

Wyświetl plik

@ -537,37 +537,37 @@ export const embedShapePermissionDefaults = {
// Disabled permissions
// ========================================================================================
// [MDN] Experimental: Allows for downloads to occur without a gesture from the user.
// [REASON] Disabled because otherwise the <iframe/> trick the user on behalf of us to performing an action
// [REASON] Disabled because otherwise the <iframe/> can trick the user on behalf of us to perform an action.
'allow-downloads-without-user-activation': false,
// [MDN] Allows for downloads to occur with a gesture from the user.
// [REASON] Disabled because otherwise the <iframe/> trick the user on behalf of us to performing an action
// [REASON] Disabled because otherwise the <iframe/> can trick the user on behalf of us to perform an action.
'allow-downloads': false,
// [MDN] Lets the resource open modal windows.
// [REASON] The <iframe/> could 'window.prompt("Enter your tldraw password")'
// [REASON] The <iframe/> could 'window.prompt("Enter your tldraw password")'.
'allow-modals': false,
// [MDN] Lets the resource lock the screen orientation.
// [REASON] Would interfer with tldraw interface
// [REASON] Would interfere with the tldraw interface.
'allow-orientation-lock': false,
// [MDN] Lets the resource use the Pointer Lock API.
// [REASON] Maybe we should allow this for games embeds (scratch/codepen/codesandbox)
// [REASON] Maybe we should allow this for games embeds (scratch/codepen/codesandbox).
'allow-pointer-lock': false,
// [MDN] Allows popups (such as window.open(), target="_blank", or showModalDialog()). If this keyword is not used, the popup will silently fail to open.
// [REASON] We shouldn't allow popups as a embed could pretend to be us by opening a mocked version of tldraw. This is very unobvious when it is performed as an action within out app
// [REASON] We want to allow embeds to link back to their original sites (e.g. YouTube).
'allow-popups': true,
// [MDN] Lets the sandboxed document open new windows without those windows inheriting the sandboxing. For example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to.
// [REASON] We're alread disabling popups.
'allow-popups-to-escape-sandbox': false,
// [REASON] We want to allow embeds to link back to their original sites (e.g. YouTube).
'allow-popups-to-escape-sandbox': true,
// [MDN] Lets the resource start a presentation session.
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us.
'allow-presentation': false,
// [MDN] Experimental: Lets the resource request access to the parent's storage capabilities with the Storage Access API.
// [REASON] We don't want anyone else to access our storage
// [REASON] We don't want anyone else to access our storage.
'allow-storage-access-by-user-activation': false,
// [MDN] Lets the resource navigate the top-level browsing context (the one named _top).
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us.
'allow-top-navigation': false,
// [MDN] Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture.
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us
// [REASON] Prevents embed from navigating away from tldraw and pretending to be us.
'allow-top-navigation-by-user-activation': false,
// ========================================================================================
// Enabled permissions