fix(core): iframe rendering issue for youtube videos (#12880)

#### PR Dependency Tree


* **PR #12880** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved iframe preview behavior for code blocks, enabling enhanced
compatibility and resource access within previews.
- **Chores**
- Updated internal server configuration to no longer set custom
cross-origin headers during development.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Peng Xiao
2025-06-20 18:19:28 +08:00
committed by GitHub
parent 62d74de810
commit da980876cb
3 changed files with 1 additions and 20 deletions

View File

@@ -67,11 +67,6 @@ export class HTMLPreview extends SignalWatcher(WithDisposable(LitElement)) {
override firstUpdated(_changedProperties: PropertyValues): void {
const result = super.firstUpdated(_changedProperties);
if (!window.crossOriginIsolated) {
this.state = 'fallback';
return;
}
this._link();
this.disposables.add(

View File

@@ -3,5 +3,5 @@ import type { CodeBlockModel } from '@blocksuite/affine/model';
export function linkIframe(iframe: HTMLIFrameElement, model: CodeBlockModel) {
const html = model.props.text.toString();
iframe.srcdoc = html;
iframe.sandbox.add('allow-scripts');
iframe.sandbox.add('allow-scripts', 'allow-same-origin');
}