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
Contact:

Announcement: Flash click to view 0.1 released!

Post by Ted Mielczarek »

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
Contact:

Post by clav »

Very nice. I've been thinking that someone should extension-ise this since you first posted the link for it.
User avatar
Spewey
Folder@Home
Posts: 5799
Joined: January 25th, 2003, 2:06 pm
Location: St. Paul, Minnes°ta

Post by Spewey »

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
Contact:

Post by clav »

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 :))
User avatar
rockstiff
Posts: 342
Joined: April 24th, 2003, 1:38 pm
Location: Lund, Sweden
Contact:

Post by rockstiff »

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 by zox »

That is awesome.
Thanks for great job and big thanks to original code developer Jesse.
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

Ted, you rock.
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

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
Contact:

Post by Ted Mielczarek »

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.
User avatar
Spewey
Folder@Home
Posts: 5799
Joined: January 25th, 2003, 2:06 pm
Location: St. Paul, Minnes°ta

Post by Spewey »

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 by tve »

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
Contact:

Post by clav »

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 by TychoQuad »

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 by tve »

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
Contact:

Post by Ted Mielczarek »

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
Post Reply