Mini Youtube Window

Opens A tiny window for background music

当前为 2020-08-26 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Mini Youtube Window
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Opens A tiny window for background music
// @author       Konghe Won
// @include      *
// @exclude      https://www.youtube.com*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
	function ask(){
	var answer = prompt("Do you want to put in the video ID of the Youtube video, just open Youtube home, search on Youtube, or don't open anything? (1,2,3,4)",1);
	if(answer != 1 && answer != 2 && answer != 3){
		ask()
	}else{
		if(answer == 1){
			var id = prompt("What is the video ID?","dQw4w9WgXcQ");
			window.open("https://www.youtube.com/watch?v="+id, "_blank", "toolbar=yes,top=500,left=500,width=600,height=400");
		}else if(answer == 2){
			window.open("https://www.youtube.com", "_blank", "toolbar=yes,top=500,left=500,width=600,height=400");
		}else if(answer == 3){
			var search = prompt("What do you want to search up?","Never Gonna Give You Up");
			search.replace(/ /g,"+");
			window.open("https://www.youtube.com/results?search_query="+search, "_blank", "toolbar=yes,top=500,left=500,width=600,height=400");
	    }else if(answer == 4){
		    return
		}
	}
	}
	ask()
})();