{"record":{"id":"e2bf956dd5c5f8f6","repo":"responsively-org/responsively-app","slug":"iframe-error","errorCode":null,"errorMessage":"iframe error:","messagePattern":"iframe error:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"desktop-app/src/renderer/components/Previewer/Device/index.tsx","lineNumber":402,"sourceCode":"    handlerRemovers.push(() => {\n      webview.removeEventListener('did-stop-loading', didStopLoadingHandler);\n    });\n\n    const didFailLoadHandler = ({\n      errorCode,\n      errorDescription,\n      isMainFrame,\n    }: Electron.DidFailLoadEvent) => {\n      if (errorCode === -3) {\n        // Aborted error, can be ignored\n        return;\n      }\n\n      // Only show error overlay for main frame errors\n      // Iframe errors (like CSP violations) should only go to console\n      if (!isMainFrame) {\n        // eslint-disable-next-line no-console\n        console.warn('iframe error:', errorCode, errorDescription);\n        return;\n      }\n\n      setError({\n        code: errorCode,\n        description: errorDescription,\n      });\n    };\n    webview.addEventListener('did-fail-load', didFailLoadHandler);\n    handlerRemovers.push(() => {\n      webview.removeEventListener('did-fail-load', didFailLoadHandler);\n    });\n\n    if (!isPrimary) {\n      setTimeout(() => {\n        webview.addEventListener('dom-ready', () => {\n          window.electron.ipcRenderer.invoke<\n            DisableDefaultWindowOpenHandlerArgs,","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/responsively-org/responsively-app/blob/e5623c5a70c0c476b3f247c8d3980c7224e36410/desktop-app/src/renderer/components/Previewer/Device/index.tsx#L384-L420","documentation":"This is not a throw but a console.warn emitted in didFailLoadHandler when a webContents 'did-fail-load' event reports isMainFrame === false. Sub-frame (iframe) load failures such as CSP-blocked resources or X-Frame-Only pages are deliberately demoted to console output so the renderer only shows a full error overlay for main-frame failures. Seeing 'iframe error:' in the console means an embedded frame failed to load, not the page itself.","triggerScenarios":"An iframe inside the loaded page fails with codes like ERR_BLOCKED_BY_RESPONSE (CSP frame-ancestors), ERR_CERT errors on embedded resources, or aborted subresource loads; the handler receives (event, errorCode, errorDescription, validatedURL, isMainFrame=false).","commonSituations":"Embedding sites that send CSP frame-ancestors or X-Frame-Options DENY, mixed-content blocked iframes, ad/analytics iframes failing in offline mode, previewing pages with third-party embeds.","solutions":["Verify the main page still renders; if it does, this warning is expected and ignorable","If the iframe content is required, fix the source page's CSP/X-Frame-Options headers to allow embedding","Whitelist known-noisy sub-frame error codes in the warn filter if console spam is an issue","If the overlay incorrectly appears, check that isMainFrame is being read from the event args and not defaulting"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedURL, isMainFrame) => {\n  if (typeof isMainFrame !== 'boolean') return;\n  if (!isMainFrame) {\n    console.warn('iframe error:', errorCode, errorDescription);\n    return;\n  }\n  setError({ code: errorCode, description: errorDescription });\n});","typeGuard":"function isMainFrameLoadFailure(args: { isMainFrame?: boolean }): args is { isMainFrame: true } {\n  return args.isMainFrame === true;\n}","tryCatchPattern":null,"preventionTips":["Always branch on isMainFrame before showing error overlays","Filter out benign sub-frame codes (aborted, blocked-by-CSP) from logging if noisy","Test previewing pages with CSP-protected iframes and ad iframes","Remember this warn is informational; the main page may be fine"],"tags":["iframe","csp","electron","webcontents","console-warning"],"backgroundTag":"iframe-load-blocked-by-csp","analyzedSha":"e5623c5a70c0c476b3f247c8d3980c7224e36410","analyzedAt":"2026-08-31T10:58:12.271Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}