Closed Bug 190970 Opened 22 years ago Closed 5 years ago

XBL binding does not work on embed tag

Categories

(Core :: XBL, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: stefan.kinitz, Unassigned)

References

Details

(Whiteboard: DUPEME)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.2.1) Gecko/20021130

Trying to bind an embed tag with xbl does not seem to work at all

Reproducible: Always

Steps to Reproduce:
1. write a binding (a simple additional attribute or something)
2. bind it to an img and an embed tag
3. use dom inspector to test the tags

Actual Results:  
3. the img tag has a new attribute, the embed tag has none

Expected Results:  
the embed tag should have a new attribute like the img tag
This is a dup of that bug about the prototype chain for plugins, almost
certainly....
Whiteboard: DUPEME
the binding:
<?xml version="1.0"?>
<bindings id="myBindings" xmlns="http://www.mozilla.org/xbl">
	<binding id="img">
		<implementation>
			<field name="tstsrc"/>
			<property name="src">
				<constructor>
					<![CDATA[
					try {
						this.tstsrc = this.src;
						this.setAttribute("src", null);
					} catch(e) {
						window.alert(this + ": " + e);
					}
					]]>
				</constructor>
			</property>
		</implementation>
	</binding>
</bindings>

The exception says:
exception... "Illegal operation on WrappedNative prototype object"
nsresult: "0x80570003c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"
location: "JS frame :: <<unknown filename>> :: onxblconstructor :: line 3"
data: no

BTW: Can anyone show me a doc that reveals all the secrets about the difference
between this.tstsrc = val and this.setAttribute("tstsrc", val) and what does
what and how to use? I'm currently guessing wild it seems?
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
This bug prevents the popular "Flash click to view" extension from working on
sites that use <embed> rather than <object> for Flash.
Not 100% sure this is the same, but this flash bypasses the flash click-to-view
plugin as well and might be a helpful test-case:

http://sanfrancisco.citysearch.com/

Specifically (as far as I can tell) this HTML:
<!-- Flash Mantel code START -->
<script LANGUAGE="JavaScript1.1"
SRC="http://ads.as4x.tmcs.net/js.ng/site=cs&pagepos=75&adsize=300x250&page=home&city=sanfrancisco&context=generic?ord='+bust+'">
</script>
 <!-- Flash Mantel code END -->

Please retest this in tomorrow's build now that bug 127418 is fixed.
Depends on: 41428
Works with embeds within objects and pure embeds and Mozilla/5.0 (Windows; U;
Windows NT 5.0; de-AT; rv:1.7a) Gecko/20040106.
The XBL binding shows up, but Flash-Click-to-View still doesn't work.  There's
probably another bug open about anonymous content and plugins, but I can't find
it right now.

Testcase: http://mavra.perilith.com/~luser/testembed.html
The XBL binding's <constructor> runs, but the <content> seems to be ignored.  I
see the same with OBJECT elements.  The XBL flash blocker only works reliably in
the case of a broken OBJECT (missing "data" and "type" params) containing a
working EMBED.

http://www.squarefree.com/xbl-test/embedtest2.htm
I rewrote the Flash Click-to-View XBL to do everything in JavaScript instead of
using <content>.  It works with EMBED tags now. 
http://www.squarefree.com/userstyles/xbl.html
jesse:
Windows 2000, firefox 0.8, fresh profile
embedtest2.htm without your code:
- div -> "click to play object" -> working
- embed, object, object cont embed -> show up
- broken object -> "click to play object" -> working

with your code:
- div -> "click to play object" = working
- embed -> shows up
- object, object cont embed -> "click to play" -> no flash after clicking
- broken object -> "click to play object" -> working

So still no sucess with embed on my machine.
Joachim: embedtest2.html is for testing this bug, not for testing the new
version of my XBL flash blocker.  If you want to use it to test the new version
of my flash blocker, you have to remove the <style> elements from embedtest2.html.
Oh sorry for this mistake. Now it works.
I was fooled because on my example page (www.hardtecs4u.com), the banners still
showed up.
There seems to be a unusual embed tag:

<EMBED src="/werbung/listan_banner_468.swf" quality="high" width="468" height="60">

I simply added another rule for the css:

embed[src*=".swf"]
As I see it this bug is fixed. If you still have problems with fctv I suggest
you open a seperate bug and we close this one as fixed?
QA Contact: ian → xbl
Assignee: hyatt → nobody

XBL is now disabled in Firefox (Bug 1583314) and is in the process of being removed from Gecko (Bug 1566221), so closing bugs requesting changes to its implementation as wontfix.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.