[Flashblock] Re: Flashblock revised XBL
Lorenzo Colitti
lorenzo at colitti.com
Tue Jan 3 23:41:01 EST 2006
gary liquid wrote:
> Ok all,
[CC'ing the FB list again to keep the others in the loop. Remember, no
man is an island!]
> > So simply doing:
> > if("src" in current) { ... }
> > in flashblockShowPlaceholder() causes an error, right?
>
> Yes thats right - I broke the code up so each portion of the expression
> was on a seperate line and the bad NP object error occurs when you try
> the expression above.
Right... if that's the cause of the problem, then the attached patch
should be enough to fix it with a minimum of code changes.
Unfortunately, I don't have a Windows box to test on. Can you check if
it fixes the problem?
I attach flashblock.xml too in case you can't use the diff somehow.
Thanks for your help so far!
Cheers,
Lorenzo
--
Lorenzo Colitti http://www.colitti.com/lorenzo/
-------------- next part --------------
? flashblock-1.5.xpi
? flashblock.xpi
? xpi.sh
Index: content/flashblock/flashblock.xml
===================================================================
RCS file: /cvs/flashblock/source/content/flashblock/flashblock.xml,v
retrieving revision 1.8.2.6
diff -u -r1.8.2.6 flashblock.xml
--- content/flashblock/flashblock.xml 1 Jan 2006 13:16:06 -0000 1.8.2.6
+++ content/flashblock/flashblock.xml 3 Jan 2006 22:33:45 -0000
@@ -22,17 +22,18 @@
}
}
-function flashblockCreatePlaceholder() {
+function flashblockCreatePlaceholder(isStandalone) {
// Create placeholder
var flashblockCreateElement = nativeMethod(document, "createElement");
var placeholder = flashblockCreateElement("div");
+ placeholder.isStandalone = isStandalone;
return placeholder;
}
// Substitute the animation with a placeholder
function flashblockShowPlaceholder() {
parent.insertBefore(placeholder, current);
- if("src" in current && current.src == current.ownerDocument.location) {
+ if(placeholder.isStandalone) {
placeholder.flashblock = "frame";
current.StopPlay();
current.LoadMovie(0, "");
@@ -134,7 +135,8 @@
current.overrideCTV = true;
// Create placeholder div
-var placeholder = flashblockCreatePlaceholder();
+var isStandalone = ("src" in current && current.src == current.ownerDocument.location);
+var placeholder = flashblockCreatePlaceholder(isStandalone);
// Set placeholder image
var type = this.flashblockType ? this.flashblockType : "flash"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashblock.xml
Type: text/xml
Size: 6204 bytes
Desc: not available
Url : http://mozdev.org/pipermail/flashblock/attachments/20060103/a17625d4/flashblock.xml
More information about the Flashblock
mailing list