mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
updates
This commit is contained in:
parent
1cf54724d6
commit
3380c79684
3 changed files with 10 additions and 13 deletions
2
dist/iframe.html → dist/embed/iframe.html
vendored
2
dist/iframe.html → dist/embed/iframe.html
vendored
|
@ -4,6 +4,8 @@
|
|||
<style type="text/css">
|
||||
* { margin: 0px; padding: 0px; }
|
||||
|
||||
html, body { height: 100%; }
|
||||
|
||||
body { background-color: #fff; }
|
||||
body.dark { background-color: #171717; }
|
||||
|
10
electron.js
10
electron.js
|
@ -25,11 +25,11 @@ const csp = [
|
|||
`default-src 'self' 'unsafe-eval' blob: http://localhost:*`,
|
||||
`img-src 'self' http://*:* https://*:* data: blob: file://*`,
|
||||
`media-src 'self' http://*:* https://*:* data: blob: file://* https://*.googlevideo.com`,
|
||||
`style-src 'unsafe-inline' http://localhost:* file://* https://www.youtube.com/`,
|
||||
`font-src data: file://* http://localhost:* https://www.youtube.com/`,
|
||||
`connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data: https://www.youtube.com/ https://*.googlevideo.com`,
|
||||
`script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline' https://www.youtube.com/`,
|
||||
`frame-src chrome-extension://react-developer-tools http://localhost:8081/iframe.html https://www.youtube.com/ https://www.vimeo.com/`,
|
||||
`style-src 'unsafe-inline' http://localhost:* file://* https://*.youtube.com/ https://*.vimeocdn.com`,
|
||||
`font-src data: file://* http://localhost:* https://*.youtube.com/ https://*.vimeocdn.com`,
|
||||
`connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data: https://*.youtube.com/ https://*.vimeocdn.com/ https://*.vimeo.com/ https://*.googlevideo.com`,
|
||||
`script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline' https://*.youtube.com/ https://*.vimeocdn.com`,
|
||||
`frame-src chrome-extension://react-developer-tools http://localhost:*/embed/iframe.html https://*.youtube.com/ https://*.vimeo.com/`,
|
||||
`worker-src 'self' 'unsafe-eval' blob: http://localhost:*`,
|
||||
];
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ const BlockEmbed = observer(class BlockEmbedIndex extends React.Component<I.Bloc
|
|||
<canvas id="chart"></canvas>
|
||||
`;
|
||||
|
||||
libs.push('./embed/chart/chart.umd.js');
|
||||
libs.push('./chart/chart.umd.js');
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
@ -470,22 +470,17 @@ const BlockEmbed = observer(class BlockEmbedIndex extends React.Component<I.Bloc
|
|||
iw.postMessage(data, '*');
|
||||
|
||||
win.off(`message.${block.id}`).on(`message.${block.id}`, (e: any) => {
|
||||
const height = Number(e.originalEvent.data.height) || 0;
|
||||
|
||||
if (height) {
|
||||
iframe.css({ height });
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
if (processor == I.EmbedProcessor.Youtube) {
|
||||
if ([ I.EmbedProcessor.Youtube, I.EmbedProcessor.Vimeo].includes(processor)) {
|
||||
sandbox.push('allow-same-origin');
|
||||
};
|
||||
|
||||
if (!iframe.length) {
|
||||
iframe = $('<iframe />', {
|
||||
id: 'receiver',
|
||||
src: './iframe.html',
|
||||
src: './embed/iframe.html',
|
||||
frameborder: 0,
|
||||
sandbox: sandbox.join(' '),
|
||||
allowtransparency: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue