您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script injects a search field into the dialog where user can save a video to a playlist. When the user starts to type an incremental search is implemented and the playlists are filtered out
当前为
// ==UserScript== // @name Youtube Save to... playlist incremental search // @namespace http://tampermonkey.net/ // @version 1.0 // @description This script injects a search field into the dialog where user can save a video to a playlist. When the user starts to type an incremental search is implemented and the playlists are filtered out // @author Jaq Drako // @match *://www.youtube.com/* // @grant none // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js // ==/UserScript== var $ = window.$; (function() { 'use strict'; $(function() { var labelExist = setInterval(function() { if ($("div#title.ytd-add-to-playlist-renderer").length) { clearInterval(labelExist); var saveToLabel = $('div#title.ytd-add-to-playlist-renderer'); saveToLabel.html("<span>Search: </span><input id='lookupSearch' type='search'/>"); $("input#lookupSearch").on("search", function() { var labels = $("ytd-add-to-playlist-renderer div#playlists div#checkbox-container yt-formatted-string#label"); labels.closest('ytd-playlist-add-to-option-renderer').show(); }); $("input#lookupSearch").keyup(function( event ) { var sv = $("input#lookupSearch").val().toLowerCase(); var labels = $("ytd-add-to-playlist-renderer div#playlists div#checkbox-container yt-formatted-string#label"); labels.each(function(data) { var label = $(this); var title = label.attr("title").toLowerCase(); if(title.indexOf(sv) > -1) { label.closest('ytd-playlist-add-to-option-renderer').show(); } else { label.closest('ytd-playlist-add-to-option-renderer').hide(); } }); }); } }, 100); // check every 100ms }); })();