Skip to content

Commit 683b438

Browse files
committed
feat(vscode-extension): add sandbox attribute to iframe for allow png export downloads
1 parent 84c1797 commit 683b438

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/mcp/src/renderer/bridge.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function buildBridgeHtml(): string {
4141
</style>
4242
</head>
4343
<body>
44-
<iframe id="qm" src="${QUICKMOCK_URL}" allow="clipboard-read; clipboard-write"></iframe>
44+
<iframe id="qm" src="${QUICKMOCK_URL}" sandbox="allow-scripts allow-same-origin" allow="clipboard-read; clipboard-write"></iframe>
4545
<script>
4646
window.__qmReady = false
4747
window.__renderComplete = false

packages/vscode-extension/src/webview/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const appOrigin = new URL(appUrl).origin;
99

1010
const iframe = document.createElement('iframe');
1111
iframe.src = appUrl;
12+
iframe.setAttribute(
13+
'sandbox',
14+
'allow-scripts allow-same-origin allow-downloads'
15+
);
1216
iframe.allow = 'clipboard-read; clipboard-write';
1317
iframe.title = 'QuickMock Application';
1418
document.body.appendChild(iframe);

0 commit comments

Comments
 (0)