MozillaZine

Announcement: Flash click to view 0.1 released!

Talk about add-ons and extension development.
Ted Mielczarek
 
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA

Post Posted May 14th, 2003, 8:48 am

Based on the wonderful work of Jesse Ruderman I've created the Flash click-to-view extension. This extension adds an XBL binding to Shockwave Flash object tags that replaces them with a button you must click in order to play the animation. Quite nice for restoring sanity to your browsing session. Note that if you have an existing userContent.css, it will be renamed to userContent-flashblock-backup.css.

Install it from:
http://ted.mielczarek.org/code/mozilla/flashblock.xpi

clav
 
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK

Post Posted May 14th, 2003, 9:29 am

Very nice. I've been thinking that someone should extension-ise this since you first posted the link for it.

Spewey
Folder@Home

User avatar
 
Posts: 5799
Joined: January 25th, 2003, 2:06 pm
Location: St. Paul, Minnes°ta

Post Posted May 14th, 2003, 9:50 am

Okay, that's neat. Can you make it so you can nuke Flash that you click to view but don't like?

clav
 
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK

Post Posted May 14th, 2003, 10:37 am

i doubt that's possible, because the flash plugin controls the context menus that are generated over it.

you might be able to create an extension which added a button below every flash animation to kill it, but that would likely mess up the layout of many pages. (not that I personally care about the layout of pages using flash, but I guess other people do :))

rockstiff

User avatar
 
Posts: 342
Joined: April 24th, 2003, 1:38 pm
Location: Lund, Sweden

Post Posted May 14th, 2003, 10:54 am

Would it be possible to make it regular small button instead of the big :hover button... It's a great extension, it's just that I find the hover thing almost more annoying than the flash ads. :D
Mozilla Firefox 0.9 20040817
Windows XP Professional SP1

zox
 
Posts: 6
Joined: March 12th, 2003, 8:29 am

Post Posted May 14th, 2003, 12:45 pm

That is awesome.
Thanks for great job and big thanks to original code developer Jesse.

seb

User avatar
 
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France

Post Posted May 14th, 2003, 1:20 pm

Ted, you rock.

Chris Cook

User avatar
 
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada

Post Posted May 14th, 2003, 4:30 pm

A thought. Shouldn't the xbl binding be in an extension css file instead of the the user-Chrome.css file?

1. The user's customizations get replaced which is annoying.
2. More importantly, the extension will only work in the current profile since a new profile would not have the necessary user-Chrome.css addition.

Ted Mielczarek
 
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA

Post Posted May 14th, 2003, 4:32 pm

Chris Cook wrote:A thought. Shouldn't the xbl binding be in an extension css file instead of the the user-Chrome.css file?

1. The user's customizations get replaced which is annoying.
2. More importantly, the extension will only work in the current profile since a new profile would not have the necessary user-Chrome.css addition.


a) Yes but I wanted to bang this extension out quickly and I didn't know how to make that work
b) It backs up your userContent.css so you don't lose them
c) The extension installs only to your profile anyway

If I get a chance (or someone tells me how) I'll fix it to use a different css file.

Spewey
Folder@Home

User avatar
 
Posts: 5799
Joined: January 25th, 2003, 2:06 pm
Location: St. Paul, Minnes°ta

Post Posted May 14th, 2003, 5:57 pm

A little proof-of-concept goin' on. People should be warned that it currently backs-up and replaces your userContent.css. I thought for a moment that the admasters had me figured out when I saw ads reappear. If people want to try it and they have existing prefs, add the new file contents to the "flashblock-backup" file.

If Flash Ownz the context menu, is it impervious to any hack w/o recompiling the plugin dll?

I wasn't going to bother with the hack so the existence of an extension is mighty handy for the lazy.
This could apply to many things but Ted is definitely Da Man for actually implementing it in this case.

tve
Moderator
 
Posts: 3275
Joined: November 6th, 2002, 12:07 pm
Location: Federal Republic of Germany

Post Posted May 15th, 2003, 8:43 am

clav wrote:i doubt that's possible, because the flash plugin controls the context menus that are generated over it.

dont know if thats possible, but maybe with a "kill all flashs on page" keyboard shortcut, or middle-click or something similar?

great extension btw :)
<i>Latest Firefox Trunk & Thunderbird 1.0</i>

clav
 
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK

Post Posted May 15th, 2003, 10:12 am

tve wrote:dont know if thats possible, but maybe with a "kill all flashs on page" keyboard shortcut, or middle-click or something similar?


a keyboard shortcut should be doable. middle click is probably not, since the plugin probably captures click events

TychoQuad
 
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post Posted May 15th, 2003, 11:39 pm

What about a flash whitelisting feature? Hide all flash windows on a certian page unless enabled? I think that would rock :)

tve
Moderator
 
Posts: 3275
Joined: November 6th, 2002, 12:07 pm
Location: Federal Republic of Germany

Post Posted May 16th, 2003, 7:26 am

TychoQuad wrote:What about a flash whitelisting feature? Hide all flash windows on a certian page unless enabled? I think that would rock :)

sounds good :)


...how can I edit the appearance of the button and the font colors?

I tried flash.xml (inside the jar archive and the one in the folder) and usercontent.css but it just doesnt seem to have any affect on flash animations :-/ (border stays red, font stays italic..)
<i>Latest Firefox Trunk & Thunderbird 1.0</i>

Ted Mielczarek
 
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA

Post Posted May 16th, 2003, 9:42 am

tve wrote:
TychoQuad wrote:What about a flash whitelisting feature? Hide all flash windows on a certian page unless enabled? I think that would rock :)

sounds good :)


...how can I edit the appearance of the button and the font colors?

I tried flash.xml (inside the jar archive and the one in the folder) and usercontent.css but it just doesnt seem to have any affect on flash animations :-/ (border stays red, font stays italic..)


flash.xml contains the XBL, which dictates the appearance of the object. You should be able to edit it and repack it and have your changes take effect.

Specifically, you'll want to play with

Code: Select all
<html:div style="background: white none repeat scroll 0%; -moz-outline-color: red; -moz-outline-style: solid; -moz-outline-width: 1px; text-align: center; color: black; -moz-background-clip: initial; -moz-background-inline-policy: initial; -moz-background-origin: initial; cursor: pointer; height: inherit; width: inherit; min-height: 1em; min-width: 1em; overflow: hidden;">
<html:span style="color: red; font-weight: bold; font-style: italic;">flash</html:span>

       [[Click to play]]
   
</html:div>


and

Code: Select all
<constructor>

        document.getAnonymousNodes(this)[0].onmouseover = function()
        {
          this.style.MozOutline='3px outset white';
          this.style.background='lightgrey'       
        }
        document.getAnonymousNodes(this)[0].onmouseout = function()
        {
          this.style.background='white';
          this.style.MozOutline='1px solid red';
        }
        document.getAnonymousNodes(this)[0].onclick = function()
        {
          this.style.display='none';
          document.getAnonymousNodes(this.parentNode)[1].style.display='inline';
        }
     
</constructor>


Hm. Now that I actually look at that, I'm sure most of it could be rewritten to use css rules instead of that onmouseover/onmouseout stuff. Oh well.

-Ted

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests