您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name Youtube Search // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Gram Parsons // @include http://tagpro-*.koalabeast.com/* // @grant none // @require http://code.jquery.com/jquery-3.3.1.min.js // ==/UserScript== (function() { 'use strict'; console.clear(); $( document ).ready(function() { //console.clear(); var myList = document.querySelector('#site-nav ul'); console.log(myList); var Youtube = document.createElement('li'); Youtube.id = "Youtube"; Youtube.class; //var a = document.createElement('a'); // a.href = "http://www.youtube.com"; // a.textContent = "Youtube"; //Youtube.appendChild(a); var box = document.createElement('input'); box.style.fontColour = 'black'; box.type ='text'; box.placeholder = 'Youtube'; box.style.color = 'black'; // box.style.backgroundColor = 'black'; Youtube.appendChild(box); myList.appendChild(Youtube); console.log(myList); box.addEventListener("keyup", function(event) { console.log(event.keyCode); console.log(box.value); if (event.keyCode === 13) { // Trigger the button element with a click //window.open('https://www.youtube.com/results?search_query=TAGPROTAMPERMONKEY'+box.value, '_blank'); window.open(window.location.href); window.location.href = 'https://www.youtube.com/results?search_query=TAGPROTAMPERMONKEY'+box.value; } }) }); })();