您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Put a good description in here
- // ==UserScript==
- // @name Youtube Mobile Seekable
- // @author erogemaster225
- // @namespace http://www.example.url/to/your-web-site/
- // @description Put a good description in here
- // @license Creative Commons Attribution License
- // @version 0.2
- // @include http*://m.youtube.com/*
- // @grant none
- // @run-at document-start
- // @released 2006-04-17
- // @updated 2006-04-19
- // @compatible Greasemonkey
- // ==/UserScript==
- setInterval(function() {
- if (location.href.indexOf('/watch') != -1) {
- let progressBar = document.querySelector('.ytm-progress-bar')
- let player = document.querySelector('video.html5-main-video')
- if (!progressBar.getAttribute('tagged') && player.getAttribute('src')) {
- progressBar.addEventListener('click', function(event) {
- let boundingRect = progressBar.getBoundingClientRect();
- let clickPosition = event.clientX - boundingRect.left;
- let progressBarWidth = boundingRect.width;
- let percentage = (clickPosition / progressBarWidth);
- player.currentTime = Math.floor(percentage * player.duration);
- });
- progressBar.setAttribute('tagged', 'true');
- console.log('tagged');
- }
- }
- }, 2000);