views:

1043

answers:

4

I was sitting here wondering if it's possible to write a greasemonkey script that would detect sites like payperclick and mute the audio so the ad isn't heard.

I realize that I could accomplish the same thing in a better fashion by simply removing the ad text through a greasemonkey script but for purposes of curiousity, I wondered if you can disable the audio through javascript.

G-Man

+2  A: 

The only way I can see this being possible is if:

1)the ad has its own "mute button" which called a javascript function...in which case you could just call that function yourself.

2) The plugin the ad is using for audio has a javascript API (same as 1)

3) IE only: some bizarre IE ActiveX thing that could probably do it...by accessing stuff that it probably shouldn't.

All of these I consider extremely doubtful

Any other possibility would be too low level for javascript to have access to (or at least I seriously hope that is the case). A browser by itself has no volume controls....all multimedia are done by plugins.

Jack
lol @ #3. ActiveX was probably one of Microsoft's worst decisions security-wise.
tj111
Hahha I agree with that one!
GeoffreyF67
+1  A: 

Other than completely stripping the <embed> element, it's a no-go; JavaScript simply doesn't have the power to access the volume controls of Flash media... yet. : )

Hexagon Theory
+1  A: 

You could try removing the autostart attribute on the embed element or setting it to false.

Zach
A: 

maybe the aswer, pass by control the browser.... maybe something that generat some incompatility in some browsers but not hack, and only controlling the browser or keyboard by user choice