Skip to content

Commit

Permalink
feat: improve iframe security
Browse files Browse the repository at this point in the history
Security update, see w3c/webextensions#637 (comment)
  • Loading branch information
vitonsky committed Jun 13, 2024
1 parent a881b3e commit 31ad3d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/offscreen-documents/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ document.addEventListener('DOMContentLoaded', async () => {

const workerIframe = document.createElement('iframe', {});
workerIframe.src = '/offscreen-documents/worker/worker.html';
workerIframe.setAttribute(
'sandbox',
'allow-same-origin allow-scripts allow-popups allow-forms',
);
workerIframe.setAttribute('sandbox', 'allow-scripts');
document.body.appendChild(workerIframe);
});
5 changes: 1 addition & 4 deletions src/requests/offscreen/customTranslators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ export const customTranslatorCreate = buildBackendRequest<
// Create iframe
const iframe = document.createElement('iframe', {});
// iframe.src = 'https://example.com';
iframe.setAttribute(
'sandbox',
'allow-same-origin allow-scripts allow-popups allow-forms',
);
iframe.setAttribute('sandbox', 'allow-scripts');
document.body.appendChild(iframe);
iframe.src = '/offscreen-documents/translator/translator.html';

Expand Down

0 comments on commit 31ad3d1

Please sign in to comment.