This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name YouTube — disable autoplay until I press Play | |
| // @namespace local.dmitry.youtube.autoplay.block | |
| // @version 2.0.0 | |
| // @description Prevent YouTube videos from auto-playing on open; only play after a recent user gesture. | |
| // @author you | |
| // @match https://www.youtube.com/* | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ChromeOptions options = new ChromeOptions(); | |
| options.addArguments("--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15"); | |
| clearBrowserCookies(); | |
| Configuration.browserCapabilities.setCapability(ChromeOptions.CAPABILITY, options); | |