Mini Youtube Window

Opens A tiny window for background music

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Mini Youtube Window
// @namespace    https://greasyfork.org/en/scripts/409994-mini-youtube-window
// @version      1.0.1
// @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()
})();