The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How provide alternative content for disabled iframes?
Christian J
post Apr 9 2014, 09:29 PM
Post #1


.
********

Group: WDG Moderators
Posts: 8,119
Joined: 10-August 06
Member No.: 7



Iframes are best avoided for many reasons. But in those rare cases where iframes "must" be used, how should we best provide fallback content for users that disable iframes?

No fallback content in HTML5

HTML4 mentions fallback content for users that disable iframes:

QUOTE
"The contents of the IFRAME element [...] should only be displayed by user agents that do not support frames or are configured not to display frames."
http://www.w3.org/TR/html401/present/frames.html#edef-IFRAME

But it seems HTML5 has removed this, as if users would never disable iframes:

QUOTE
"An iframe element never has fallback content
[...]
Descendants of iframe elements represent nothing. (In legacy user agents that do not support iframe elements, the contents would be parsed as markup that could act as fallback content.)"
http://www.w3.org/TR/html5/embedded-conten...-iframe-element

Note how HTML5 only acknowledges "legacy user agents that do not support iframe elements", while ignoring those that are "configured not to display frames". Is this omission intentional? Does HTML5 want to deny users the choice of disabling iframes? If so, could it be because certain W3C members are advertizing companies, and ads are often loaded in iframes? In contrast, HTML5 still acknowledges that users may disable scripting ("many users disable scripting"), or image loading.

Browser support of fallback content

Today's popular browsers make it hard to block iframes, but at least Firefox lets you do it with extensions or about:config settings (don't know about MSIE or Chrome). Unfortunately such iframe blocking doesn't make the fallback content appear:

- In Firefox, extensions like NoScript or RequestPolicy may display a placeholder for blocked iframes. Fallback content is not shown.

- In K-Meleon 1.5.4, blocked iframes disappear completely. Fallback content is not shown.

- In (classic) Opera 12, fallback content does appear, but as raw HTML code (so e.g. a link to the framed page isn't clickable).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 9 2014, 09:49 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,227
Joined: 9-August 06
Member No.: 6



No idea what the HTML5 authors mean, but I dare say that they usual fallback method will work for many years yet no matter what doctype is on top of the page.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 10 2014, 07:13 AM
Post #3


.
********

Group: WDG Moderators
Posts: 8,119
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Apr 10 2014, 04:49 AM) *

I dare say that they usual fallback method will work for many years yet

Read my post again pandy. wink.gif None of my browsers that let me disable iframes show the fallback content properly.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 10 2014, 07:28 AM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,227
Joined: 9-August 06
Member No.: 6



And that has what to do with HTML5? tongue.gif

Haven't given this much thought, but did you try NOFRAMES and restarting the browser after having changed the settings?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 10 2014, 08:44 AM
Post #5


.
********

Group: WDG Moderators
Posts: 8,119
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Apr 10 2014, 02:28 PM) *

And that has what to do with HTML5? tongue.gif

"An iframe element never has fallback content". NOFRAMES isn't part of HTML5 either.

The way browser extensions deal with fallback content (i.e. ignoring it) may not bet ideal, but it doesn't seem to violate HTML5, since there is no fallback content in HTML5.

QUOTE
did you try NOFRAMES

Now I have. It seems my K-Meleon actually supports NOFRAMES, not just in FRAMESET but even on ordinary web pages. Same goes for Firefox when you set about:config > browser.frames.enabled to false. Unfortunately the Firefox extensions I tried don't change this setting, so the NOFRAMES element is never activated. This is obviously an issue with these extensions, maybe they don't bother with HTML4 support. It might be easy to fix with something like this in a user stylesheet:

CODE
noframes {display: inline-block !important;}

Also, since NOFRAMES is not valid HTML5 you must stick with HTML4 to validate. Not that validation feels that great if it means being force-fed with standards-compliant iframe ads.

This post has been edited by Christian J: Apr 10 2014, 09:32 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 10 2014, 09:26 AM
Post #6


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,227
Joined: 9-August 06
Member No.: 6



I mean what has THAT to do with that it actually doesn't work in your browsers? It works in K-Mel but it takes NOFRAMES. I'm not interested enough to google up how to disable frames in FF.

Maybe that HTML5 phrasing is a hat tip to AdSense and the like? If people can't use those ad servers they won't use HTML5 either and ads don't really need alternate content, at least no one cares if they have it or not. Every version of HTML as long as I've been around has been a mix of what the web should be and what it actually is, so it's actually possible I'm correct. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 10 2014, 07:17 PM
Post #7


.
********

Group: WDG Moderators
Posts: 8,119
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Apr 10 2014, 04:26 PM) *

I mean what has THAT to do with that it actually doesn't work in your browsers?

What that? Please quote when replying, otherwise I don't understand. sad.gif

Again, the topic is how to provide alternative content for disabled iframes. This should involve both the spec and browser support. Not sure if it should also involve iframes disabled by browser extensions, but why not, as long as the extensions follow the spec?

QUOTE
Maybe that HTML5 phrasing is a hat tip to AdSense and the like?

Yes, but rather because Adsense is owned by W3C member Google. Imagine the horror if the general public learned that simply disabling iframes would:

* remove many annoying ads
* speed up page loading and rendering immensely
* save lots of bandwidth
* prevent ad companies from tracking users
* prevent possible malware injection from compromised ad networks

--and all this with almost no side effects on most websites. Lots of sites would lose much of their ad incomes, and the ad networks would lose even more.

(IMHO, sites that allow third party ad networks to inject obscure ad scripts are showing disrespect towards their visitors. Ads should be selected individually and hosted by the sites themselves. Less convenient, but more ethical, and the sites would be forced to take direct responsability for the ads they allow.)

QUOTE
ads don't really need alternate content, at least no one cares if they have it or not.

True. I'm thinking of the rare cases when iframes might be used for something good, and other technologies wouldn't work as well.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 10 2014, 09:02 PM
Post #8


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,227
Joined: 9-August 06
Member No.: 6



What does HTML5 rules have to do with what browsers actually support? You said your browsers don't show noframes content when frames are disabled (but then it turned out they did).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 11 2014, 12:40 PM
Post #9


.
********

Group: WDG Moderators
Posts: 8,119
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Apr 11 2014, 04:02 AM) *
You said your browsers don't show noframes content when frames are disabled (but then it turned out they did).

No, IFRAME content and NOFRAMES content are not the same thing. My first post only dealt with IFRAME content:

CODE
<iframe src="">
<p>content</p>
</iframe>

which is removed (=not allowed?) in HTML5, and is not supported by any of my browsers (except classic Opera, but Opera12 displays its HTML tags as raw code).

Then you reminded me of the NOFRAMES element:
CODE
<noframes>
<p>content</p>
</noframes>

but that's removed in HTML5 too. At least it's still supported by Gecko browsers, but only when frames are disabled by the browser, not when disabled by the extensions I tested.

There are two problems with this:

1. HTML5 refuses to acknowledge that users may disable iframes (unlike disabling e.g. images or script) by outrageously removing the two HTML4 fallback mechanisms above.

2. How should page authors deal with users that disable iframes? By using HTML4's NOFRAMES, and avoiding HTML5 altogether? Alas not even the NOFRAMES element works with extensions (and I suspect the majority of people that disable iframes use extensions). At least we might ask extension creators to add NOFRAMES support...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 11 2014, 12:53 PM
Post #10


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,227
Joined: 9-August 06
Member No.: 6



OK, I thought you knew that you had to use NOFRAMES.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st April 2019 - 11:14 PM