NanoPi / twitch tv popout title

// ==UserScript==
// @id             twitch tv popout title
// @name           twitch tv popout title
// @version        2018.01.08
// @namespace      https://openuserjs.org/users/NanoPi
// @author         
// @description    
// @include        http://*.twitch.tv/*/popout
// @include        http://*.twitch.tv/*/chat*
// @match          http://*.twitch.tv/*/popout
// @match          http://*.twitch.tv/*/chat*
// @match          https://*.twitch.tv/*/popout
// @match          https://*.twitch.tv/*/chat*
// @match          https://player.twitch.tv/*
// @match          http://*.twitch.tv/*/popout
// @match          http://*.twitch.tv/*/chat*
// @match          http://player.twitch.tv/*
// @run-at         document-idle
// @license MIT
// ==/UserScript==

(function(){
	var re = /^\/(.*)\/popout$/;
	if (document.location.pathname.match(re))
        document.title = document.location.pathname.replace(re,'$1')+' - Twitch Video';
	re = /^\/popout\/(.*)\/chat$/;
	if (document.location.pathname.match(re))
        document.title = document.location.pathname.replace(re,'$1')+' - Twitch Chat';
	re = /.*channel=([^&]+).*/;
	if (document.location.search.match(re) && document.location.hostname == "player.twitch.tv")
        document.title = document.location.search.replace(re,'$1')+' - Twitch Video';
})();