Skip to content

Commit 3cac138

Browse files
committed
Show the error overlay only for mainframe errors
1 parent 5323ae7 commit 3cac138

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

desktop-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
"collective": {
256256
"url": "https://opencollective.com/responsively"
257257
},
258-
"devEngines": {
258+
"engines": {
259259
"node": ">=14.x",
260260
"npm": ">=7.x"
261261
},

desktop-app/src/renderer/components/Previewer/Device/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,21 @@ const Device = ({ isPrimary, device, setIndividualDevice }: Props) => {
336336
const didFailLoadHandler = ({
337337
errorCode,
338338
errorDescription,
339+
isMainFrame,
339340
}: Electron.DidFailLoadEvent) => {
340341
if (errorCode === -3) {
341342
// Aborted error, can be ignored
342343
return;
343344
}
345+
346+
// Only show error overlay for main frame errors
347+
// Iframe errors (like CSP violations) should only go to console
348+
if (!isMainFrame) {
349+
// eslint-disable-next-line no-console
350+
console.warn('iframe error:', errorCode, errorDescription);
351+
return;
352+
}
353+
344354
setError({
345355
code: errorCode,
346356
description: errorDescription,

0 commit comments

Comments
 (0)