Discussion:
Firefox 22 hidden NPAPI
s***@gmail.com
2013-07-04 08:06:35 UTC
Permalink
Hello,

It seems that the NPAPI plugins which have the attribute hidden="true" in an 'embed' element are not loaded.
1. Is this a new feature in firefox 22?
2. What is the best solution/workaround for this?

P.S. This behaviour can be tested with the VLC plugin http://www.htmlcodetutorial.com/embeddedobjects/_EMBED_HIDDEN.html.
Boris Zbarsky
2013-07-04 14:24:15 UTC
Permalink
Post by s***@gmail.com
It seems that the NPAPI plugins which have the attribute hidden="true" in an 'embed' element are not loaded.
1. Is this a new feature in firefox 22?
It's a fix for a spec compliance bug.

In Firefox 21, <embed> styled with display:none does not instantiate the
plug-in.

Per HTML5 spec, the "hidden" attribute makes the element be styled with
display:none.

In Firefox 21, we do that for all elements _except_ <embed>.

Firefox 22 removed the exception for <embed> so that we are now
following the spec.

Do other UAs do something different here? If so, what?
Post by s***@gmail.com
2. What is the best solution/workaround for this?
width=0 height=0 instead of the hidden=true, probably.

-Boris
s***@gmail.com
2013-07-05 11:11:42 UTC
Permalink
Post by Boris Zbarsky
Post by s***@gmail.com
It seems that the NPAPI plugins which have the attribute hidden="true" in an 'embed' element are not loaded.
1. Is this a new feature in firefox 22?
It's a fix for a spec compliance bug.
In Firefox 21, <embed> styled with display:none does not instantiate the
plug-in.
Per HTML5 spec, the "hidden" attribute makes the element be styled with
display:none.
In Firefox 21, we do that for all elements _except_ <embed>.
Firefox 22 removed the exception for <embed> so that we are now
following the spec.
Do other UAs do something different here? If so, what?
Post by s***@gmail.com
2. What is the best solution/workaround for this?
width=0 height=0 instead of the hidden=true, probably.
-Boris
Thank you!

It seems that width=0 height=0 does not suffice, the element is still taking some space. This is how I've tested:

<!DOCTYPE HTML>
<html>
<body>
<p>Before embed</p>
<embed type="video/ogg" style="visibility:hidden;width:0px;height:0px;margin:0px;padding:0px;border-style:0px;border-width:0px;max-width:0px;max-height:0px" />
<p>After embed</p>
</body>
</html>

Loading...