I only need to know if the iframe load failed – either because of a network error or because of an HTTP status code >= 400; the latter being the more prevalent case. I don't need to know why the iframe load failed. In my testing I managed to receive the load event in both error and success cases. I did not receive an error event in any case.
On Wednesday, November 17, 2021 at 11:24:59 AM UTC-8 Daniel Cheng wrote: > The iframe element supports "load" and "error event listeners. Is the > exact HTTP error needed? Or does the feature just need to know if it > succeed or not? > > Daniel > > On Wed, 17 Nov 2021 at 11:19, Tibor Goldschwendt <tib...@chromium.org> > wrote: > >> +Nasko Oskov >> >> Thanks, Kahmy. Adding custom code in the browser process is another >> avenue I'm exploring. Generally though, how do pages deal with broken >> iframes? >> >> On Wed, Nov 17, 2021 at 6:39 AM K. Moon <km...@chromium.org> wrote: >> >>> This would violate the same-origin policy, so I don't think you can do >>> this within Blink, but given this is a chrome: page, maybe you could add >>> some code in the browser to give this information to you. >>> >>> On Tue, Nov 16, 2021, 4:40 PM Tibor Goldschwendt <tib...@chromium.org> >>> wrote: >>> >>>> Hi Blink Dev! >>>> >>>> Is there any way to get the HTTP return code of a cross-domain iframe? >>>> FWIW, the hosting page has the chrome:// scheme while the iframe has >>>> https:// scheme. From my limited testing I receive the load >>>> <https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event> event >>>> in all scenarios but couldn't find a way to query whether the load >>>> succeeded. I also tried window.addEventListener('error', ...) and >>>> iframe.addEventListener('error', ...) without any luck. >>>> >>>> Best regards, >>>> Tibor >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "blink-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to blink-dev+...@chromium.org. >>>> To view this discussion on the web visit >>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFgr3n%2B8i%2BNQNSJY0DFab9JrXG0QTq3W473t-beRtPYbLn1XjA%40mail.gmail.com >>>> >>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFgr3n%2B8i%2BNQNSJY0DFab9JrXG0QTq3W473t-beRtPYbLn1XjA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to blink-dev+...@chromium.org. >> > To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFgr3nL-J4A0bQuXnU1Ns-eUYLNqVV65KZLeY3HuiPuBYQQmiQ%40mail.gmail.com >> >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFgr3nL-J4A0bQuXnU1Ns-eUYLNqVV65KZLeY3HuiPuBYQQmiQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a0c0d3d4-d078-4b6d-b8bd-466311ee7422n%40chromium.org.