Error page on non-existing HTML
Moderators: trava90, athenian200
Error page on non-existing HTML
Sometimes the web server doesn't send any HTML when returning error code 404 on navigating to non-existent HTML file. I think it would be user friendlier if the browser provided own error page in this case to notify the user what's wrong. At least I would prefer it to plain whiteness.
Similarly, if there are other HTTP errors that result in plain whiteness.
Similarly, if there are other HTTP errors that result in plain whiteness.
Re: Error page on non-existing HTML
This would be something for an extension to do. I don't think it belongs in the core platform because it would essentially break adherence to the http protocol standard. It's up to web servers to provide informative responses in "not-ok" situations. It doesn't matter whether the response is a 200 or 4xx or 5xx response.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
- RealityRipple
- Keeps coming back
- Posts: 810
- Joined: 2018-05-17, 02:34
- Location: Los Berros Canyon, California
- Contact:
Re: Error page on non-existing HTML
Thanks, guess it'll have to do.
Re: Error page on non-existing HTML
One issue, eg. when you open a PDF on Mobileshop (applies to any site that serves PDF file), it thinks the page is blank and puts an error on top after few seconds, even though the PDF is being rendered just fine with the NPAPI plugin.
Example URL: https://www.mobileshop.eu/si/specifikacije-pdf/4d69e7b48249d4b5acfe43cfb2ab672eeaa546dac9f08f0cf639fc59ea27b7ed/
More permanent URL: https://upload.wikimedia.org/wikipedia/commons/d/d3/Test.pdf
Workaround is manually removing added iframe through dev tools. The issue does not occur if PDF.js extension is used instead of the NPAPI plugin.
Last edited by UCyborg on 2025-02-05, 22:10, edited 1 time in total.
- RealityRipple
- Keeps coming back
- Posts: 810
- Joined: 2018-05-17, 02:34
- Location: Los Berros Canyon, California
- Contact:
Re: Error page on non-existing HTML
I'm guessing that means canvas elements can't capture plugin stuff with drawWindow().
Re: Error page on non-existing HTML
How about adding this check to BlankPageChecker function?
Code: Select all
if (wnd.contentDocument.plugin !== undefined)
return;
Last edited by UCyborg on 2025-02-06, 07:42, edited 1 time in total.
Re: Error page on non-existing HTML
BTW, about the presence of wnd.contentDocument.body, according to JavaScript wizards, that check could be shortened to:
if this is ever actually null, I'd guess it's either there and usable (not undefined) or not, similarly for plugin. Unless assuming being good practice defending against oddities. 
Code: Select all
if (wnd.contentDocument.body == null) // catches both null and undefined

- RealityRipple
- Keeps coming back
- Posts: 810
- Joined: 2018-05-17, 02:34
- Location: Los Berros Canyon, California
- Contact:
Re: Error page on non-existing HTML
What check are you talking about? Lines 165 and so on?
Re: Error page on non-existing HTML
The one on line 163:
AFAIK, it's equivalent to:
So if we have to be picky about both null and undefined state, I suppose you can add:
before wnd.contentDocument.body check above or maybe after:
To handle the case when NPAPI plugin is involved.
Code: Select all
if (wnd.contentDocument.body === null || wnd.contentDocument.body === undefined)
Code: Select all
if (wnd.contentDocument.body == null)
Code: Select all
if (wnd.contentDocument.plugin != null)
return;
Code: Select all
if (wnd.contentDocument.body.scrollWidth > wnd.contentDocument.documentElement.clientWidth)
return;
- RealityRipple
- Keeps coming back
- Posts: 810
- Joined: 2018-05-17, 02:34
- Location: Los Berros Canyon, California
- Contact:
Re: Error page on non-existing HTML
Sorry, that was changed two months ago. I know what to check and where to put it, I was just confused because I wasn't looking at the older released version's code.UCyborg wrote: ↑2025-02-06, 07:30The one on line 163:
Code: Select all
if (wnd.contentDocument.body === null || wnd.contentDocument.body === undefined)
Re: Error page on non-existing HTML
Oh, I wasn't looking at the repo...aye, it's how I'd do it.