Javascript 中的音频静音?

发布于 2024-07-13 12:29:37 字数 163 浏览 10 评论 0原文

我坐在这里想知道是否可以编写一个greasemonkey 脚本来检测payperclick 等网站并将音频静音,这样就听不到广告。

我意识到我可以通过简单地通过greasemonkey脚本删除广告文本来以更好的方式完成同样的事情,但出于好奇,我想知道是否可以通过javascript禁用音频。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

淡水深流 2024-07-20 12:29:37

能够看到这种情况的唯一方法是:

1) 广告有自己的“静音按钮”,它调用 JavaScript 函数...在这种情况下,您可以自己调用该函数。

2) 广告用于音频的插件有一个 javascript API(与 1 相同)

3) 仅限 IE:一些奇怪的 IE ActiveX 东西可能可以做到这一点......通过访问它可能不应该访问的东西。

所有这些我都认为非常可疑

任何其他可能性对于 javascript 来说都太低级而无法访问(或者至少我认真希望情况如此)。 浏览器本身没有音量控制......所有多媒体都是通过插件完成的。

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.

錯遇了你 2024-07-20 12:29:37

除了完全剥离之外, 元素,这是不行的; JavaScript 根本没有能力访问 Flash 媒体的音量控件……目前还没有。 :)

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. : )

等待圉鍢 2024-07-20 12:29:37

您可以尝试删除 embed 元素上的 autostart 属性或将其设置为 false。

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

别把无礼当个性 2024-07-20 12:29:37

也许是问题,通过控制浏览器......也许会在某些浏览器中产生一些不兼容,但不会破解,并且仅通过用户选择控制浏览器或键盘

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文