Giter Site home page Giter Site logo

eloston / disable-html5-autoplay Goto Github PK

View Code? Open in Web Editor NEW
240.0 240.0 46.0 135 KB

[CURRENTLY UNMAINTAINED] An extension for Chromium-based browsers that disables autoplay of HTML5 audio and video

License: GNU General Public License v3.0

JavaScript 73.70% HTML 26.30%

disable-html5-autoplay's People

Contributors

eloston avatar tdierks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disable-html5-autoplay's Issues

add enable autoplay

Will you add enable autoplay option? or show me the code that can enable autoplay, so i will do it :)

Calgary Herald Videos still autoplaying

When I went to the Calgary Herald site today and opened an article containing and HTML5 video, the video still played despite this extension.
Address: http://www.calgaryherald.com/business/alberta+reveals+more+details+carbon+levy+rebates/11866119/story.html

Element from the web page:
<video id="ooPlayer0container_Player_html5_api" data-account="4077388043001" data-player="4a521d08-c17d-425f-ba6e-dddedfd26d9a" data-embed="default" data-setup="{&quot;techOrder&quot;: [&quot;html5&quot;, &quot;hls&quot;, &quot;flash&quot;]}" class="vjs-tech" preload="none" style="display: block;" src="http://cdnbakmi.kaltura.com/p/1698541/sp/169854100/playManifest/entryId/0_6gmjjsc8/flavorParamId/487051/format/url/protocol/http/a.mp4"></video>

Browser: Chrome Version 50.0.2661.75 beta (64-bit)
Extension: Disable HTML5 Autoplay Version 0.6.1

Add project page

The project page will be the source of information for anything related to this project. This includes a blog for development updates. Support for feeds in the blog would be nice.

Probably going to add this after I get a lot more work done on the extension.

Playback authorization by input events algorithm is too lax

This is a clarification of an earlier report (might have been in the play store).

In Chrome, if I right-click on "154 comments" for a shared video and then click "Open in new tab" and I immediately switch to that tab with a keyboard shortcut (CTRL+Page Down) before the page/video is done loading, the video still autoplays for me. If I wait any amount of time before switching, it won't, and if I force refresh the page while looking at it, it doesn't.

I also use ABP and Session Buddy.

Thanks.

sekindo ad still autoplays

I visited the website howtogeek.com (while doing a google search to figure out how to stop HTML5 videos from buffering, which seems to be a pipe dream) to see an ad from sekindo.com playing automatically. I've seen this ad on several other websites, and each time it plays automatically, regardless of autoplay settings. Running disable-html5-autoplay 0.6.1 under chrome 42. Here's the video tag when I inspect the element.

<video width="300" height="250" autoplay="" src="https://video.sekindo.com/uploads/video/the_cure_to_overeating_mini.mp4" style="top: 0px; z-index: 2; display: block;"></video>

Clarify reason for accessing browsing history

Per the install instructions in Chrome, this plugin "Can read your browsing history."

  1. Why? All the plugin needs to do to do its job is look for the offending audio/video of the loading page and block it. It does not need access to browsing history.
  2. Is the user's browsing data reported from the plugin to Eloston or to other parties?

Reading browsing history is potentially a privacy violation if the data leaves the user's computer.

If data does leave the computer then it should be declared in the plug-in description.

Further, if there is some functional advantage to reading browsing history, then there should be an option to disable the reporting of such data outside the user's computer.

screen shot 2015-11-26 at 11 53 59

videos from usatoday.com still autoplay

URL: http://www.usatoday.com/story/news/politics/elections/2016/04/28/ted-cruz-california-primary-donald-trump-fiorina/83641576/
Element in this article that autoplays is a video at the top of the article. 'Inspect' says the URL for the video is: http://videos.usatoday.net/Brightcove2/29906170001/2016/04/29906170001_4869360653001_4868940407001.mp4
But pretty much any article at USA Today with a video will autoplay.
I also have Ad Block Plus (which I tried disabling) and have configured Chrome to block flash plugins until I click (which I also tried disabling).
Steps to cause it to break: Just load the article

Frame script not working properly in an iframe

Reported by user Keima Katsuragi in a review on the Chrome Web Store. Description: "Para el autoplay de la gran mayoria pero no total... o es que quizas este fallando el addon... ,por ejemplo en la web www.anime.moe >>"

"www.anime.moe" does not exist, but a quick Google search reveals www.animeid.moe to be an existing website, which redirects to www.animeid.tv. I assume that this is the website the reviewer is referring to.

Any video on that website seems to autoplay. Here's what I found so far in my investigation:

  • Videos are using browser controls
  • Videos live in an iframe with a src URL that has the same domain as the page.
  • The autoplay attribute is not removed from the video element
  • No media statistics are shown in the popup
  • The play method of the video element is the one used for undelegated elements (it should be the one defined in BrowserControlsDelegate). This confirms that the frame script has run, but is not detecting new media elements.
  • No uncaught exceptions are thrown anywhere in all parts of the extension

I will investigate the problem further in the near future.

landing page for cbsnews.com is autoplaying

In Opera 33.

And feature suggestion: if you could maintain a whitelist of sites permitted to play, that would be huge.
I would accept it, even if it would require editing a text file...

Finding a new way to run content scripts

The current method of running frame scripts has several problems:

  • window.postMessage can be picked up by scripts in the page (which is currently used to prevent the frame script from injecting twice into the page due to the way chrome.tabs.executeScript is run)
  • There's no way to get the mode without making additional asynchronous calls. It's important for the frame script to know the mode on initialization so it can know whether to stop autobuffering or not.

I've come up with three solutions that make use of content scripts declared in the manifest:

  • Send a message to the background page and run the sendResponse method (which I think runs synchronously) with the mode as an argument (or don't run it at all if the mode is "nothing".)
  • Run chrome.tabs.getCurrent and chrome.runtime.getBackgroundScript at the same time in the content script, and have both callbacks attempt to run a function in the background script to get the mode (based on the tab id.)
  • Have chrome.tabs.executeScript set a variable that the content script defined in the manifest file can read.

The question is, which method is fastest? Is there a faster method not listed above?

Extend domain selection capabilities of mode rules

Extend mode rules functionality to allow domains of any level.

  • Rules with a higher domain level will have precedence over those of a lower level for a given domain name.
  • Mode settings in popups will create or modify a rule with a matching domain name of the current page.
  • Delete rules that match the default mode
    • Add a rule parameter to protect rules from deletion

Also, prevent duplicate domain names in the options page.

CNN videos switch sources when autoplay is disabled

Recently, CNN videos will switch video sources if the current source doesn't play (after a certain time?) This causes it to eventually switch to an m3u8 source which Chrome cannot play.

A possible solution is to modify BrowserControlsDelegate and UnknownDelegate to trick the page into thinking that the media is actually playing, though I'm not sure how this could be done yet. This solution may also prevent other media players from breaking.

Another solution is to write CNN specific code (or whatever media player they're using)

Toggle button doesn't remember whitelisted URLs (Opera)

When I toggle the button to 'Nothing' on YouTube, the extension remembers my selection during the current session. After restarting the browser, it is as if I never whitelisted the YouTube domain and the toggle is back to blocking autoplay.

I'm using Opera stable (32.0.1948.69) on Win10 Home, Flash PPAPI installed, and third-party cookies blocked in the preferences (with YouTube NOT whitelisted).

Extension breaks playback in SoundCloud

SoundCloud won't play HTML5 audio with this extension enabled, notably after hitting the 'play' button (which is not an "autoplay" functionality). I've toggled the extension enable checkbox four times and checked if the audio plays after a page reload each time. I'm seeing a consistent pattern of the audio playing only when "disable-html5-autoplay" is not enabled.

Add debug logging

Add an option to enable debug logging. There should be a place in the options menu to access the logs so people can include them in bug reports.

Debug logging should be disabled by default.

Wishlist: permanent resumed state

A wishlist idea: add an option to stay in a permanent "resumed state", where the videos don't start automatically, but it's possible to start them with their play button, without having to switch from the "suspended state" to the "resumed state".

Also, I'd suggest to exchange the icons for the two states.

Thanks!

About.com autoplays

Reported by Mark Booth on the Chrome Web Store.
Title: Not disabling autoplay on about.com
Description:

http://cellphones.about.com/od/roamingpoliciesbycarrier/qt/metropcsroaming.htm

This still autoplays when you scroll down. They appear to be autoplaying a bit differently.

The video consistently autoplays when my ad-blocker is disabled and the video is visible.

Youtube pauses video automatically, but can't resume

Youtube has a feature that stops playback when the buffer size is not large enough for continuous playback. Usually, this happens at the start of playback, or sometimes in the middle of it. The duration of the stop on a good connection is less than 1 second, however Youtube is not able to resume automatically.

There are 2 solutions to this:
a) once video playback has been enabled for a particular tab session (by clicking play), then further clicks should be allowed. This seems very relevant to most use-cases, as if the tab had asked for permission to play videos and is for the time being "trusted".
b) detect auto-stops and allow a window of 3-10 seconds for auto-resume.

Overhaul options

The Mode Rules List is very limiting. It needs to be replaced with a new system.

More information will come after I've worked out the details (most likely after the 0.7 release).

Thanks Piter432 for inspiring me in #17.

WebRTC broken (e.g. Google Hangouts and Blue Jeans meetings)

With Disable HTML5 Autoplay running, incoming WebRTC video in both Google Hangouts and Blue Jeans meetings becomes extremely choppy, as does the "self view" window. All frames are dropped for several seconds, followed by a handful of frames making it through, followed by more frames being dropped.

To reproduce, just install the extension and attempt to have a Google Hangouts meeting. Observe what happens with the incoming video and the self-view video. Then disable the extension and observe that it all returns to normal.

Add option to show an icon over media elements

It can be hard to tell what media has been stopped by this extension, and even harder to selectively choose which media to play.
Add an option to show an icon over unknown media types that have been stopped.

  • It should be toggleable per-site and globally
  • When the icon is clicked, the media should play

Autoplay of audio from chat box

At the following URL, which requires logging in with a Google account, a chat window pops up after logging in, and audio starts playing automatically which consists of the computer speaking the text from the chat window:

http://outliner.setpixel.com/

I tried looking at the javascript console and I found something regarding an HTML audio element, so I assume this is an HTML5 issue. I don't know whether this counts technically as an "autoplay" issue.

Operating System: Mac OS 10.10.4
Chrome Version: 44.0.2403.155 (64-bit)
Extension Version: 0.4.2 (updated with Fix #7 )

Content scripts are not injecting into some empty iframes

The content scripts are not injecting into some empty iframes. This may be due to the current injection method since the content scripts are only injected when the onCommitted webNavigation event fires for http, https, and file protocols. Thus, this may be fixed with the switch back to manifest content scripts in #23.

An example of this is the Vidible media player when set to use iframes.
This is an example of the Vidible player autoplaying without the extension detecting any media: http://www.codingforums.com/javascript-programming/17254-javascript-documentation-references.html
This is relevant documentation on Vidible: https://vidible.atlassian.net/wiki/display/SUP/Player+Tag+API#PlayerTagAPI-Tags

YouTube play/pause button in a random state after page load

Hello,

first of all thanks for developing this extension, it might be the first sane autoplay blocker available. What I'm reporting here is that when I load a YouTube page the play/pause button is in a random state, and this is a bit confusing, especially in the beginning. I hope this can be fixed.

Thanks!

Improve user interface

Make the user interface more friendly, and make features and important documentation (e.g. troubleshooting) more obvious.

Quite a few users do not know about some features that are already implemented and documentation on the Wiki, as evident from closed bug reports on GitHub and reviews and support issues on the Chrome Web Store.

Planned changes:

  • Add more descriptions in the popup
  • Add welcome page to let new users and those who updated aware of the features and documentation
  • Update options page to remove superflous terminology, like Mode Rules, Mode Rules List, etc.

For Opera Users

It would be great if you could submit this extension to the Opera Addons Catalog as well. It accepts crx files as well, so if you want, you can submit this exact same crx extension that you use for the chrome store and submit it to the Opera addons catalog too, so that Opera users can also install it properly from the official channel.

(I can help you out with the whole process of submitting it to the catalog too, if you want).

Refactor everything

Massive changes are on the way:

  • Convert everything to strict mode, use more ES6-style syntax (e.g. classes)
    • Also use OOP
  • Switch all communications to ports
  • Rewrite frame script algorithm
    • Use Object.defineProperty to create hooks into HTMLMediaElement.prototype attributes and methods
    • Intercept and stop media events when disabling autoplay. Emit fake events instead
    • Replace media delegate system with a highly configurable per-element delegate (configuration options come in a later release)

Not working in Chrome 43.0.2357.134 / linux

Using Chrome 43.0.2357.134 on Linux, extension version 0.6.1.

The extension never enables and does not work.

When I go to the options page, I'm getting

Uncaught SyntaxError: Unexpected token [      options.js:24

in the developer tools menu.

Blab.im breaks

I enjoy using Blab.im which uses webRTC technology. This extension was blocking the receiving of Video and Audio.

Is there a way to white-list certain web sites or urls to allow video/audio? I'd like to use the ex to stop videos from playing automatically across web sites I visit. But, I didn't know it would prevent me from using live video on the site I want to use.

Stop media buffering

I would like to know if this extension prevents HTML5 videos from both buffering and auto-playing? Or does it only stop them from auto-playing?

The reason I ask is that I have a limited 100MB daily bandwidth plan using my 3 USB key, and so I want to conserve bandwidth while browsing.

Thank you.

having a rule for a subdirectory of a domain?

I want "youtube.com/watch" to still autoplay, but not the rest of YouTube. Specifically "youtube.com/user" should not autoplay. Channels that have an autoplaying video on their channel page drive me mad, and they're the main reason I got this addon.

Button not working

The new button seems not to be working on my system. At first it appeared in color and autoplay was disabled (as expected). Clicking the button produced no discernible change in appearance or behavior. At some point today the button changed to grey and autoplay became enabled. Now, the button seems to be stuck on grey and clicking it seems to do nothing. And autplay is still enabled.

System: OS 10.10.4, Chrome version 44.0.2403.130
Extension version: 0.4.1

Rewrite YouTube algorithm

The current YouTube algorithm is too sloppy and breaks in some cases.

The algorithm needs to be rewritten to accomplish the following:

  • Work with advertisements that play before the actual video
  • Make pausing faster. Some videos take a few seconds before they can be played with the current algorithm
  • Stop autobuffering if requested

Add options page and persistent whitelist

Add an options page and a persistent whitelist. The persistent whitelist will be customizable in the options page.

The whitelist should have regular expressions support.

EDIT: The whitelist feature is now known as mode rules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.