Adjust Twitch streams for a vertical orientated monitor.
当前为
// ==UserScript==
// @name Vertical Stream Magic
// @namespace http://greasyfork.org/users/2240-doodles
// @author Doodles
// @version 1
// @description Adjust Twitch streams for a vertical orientated monitor.
// @include *://www.twitch.tv/*
// @exclude *://www.twitch.tv/*/*
// @exclude *://www.twitch.tv/settings
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @updateVersion 1
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
'use strict';
if($("meta[property='og:video']").length !== 0 && $("meta[property='og:video']").attr("content").indexOf("channel=") != -1){
var channelName = document.URL.split("twitch.tv/")[1].split("&")[0].split("#")[0];
$('script').each(function () { $(this).remove(); });
$('body').html('' +
'<iframe src="https://player.twitch.tv/?channel='+channelName+'" id="stream" height="603" width="1072" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>' +
'<iframe src="https://www.twitch.tv/'+channelName+'/chat?popout=" id="chat" height="633" width="1072" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>' +
'');
$('head').html('<title>'+channelName+'</title>');
$('body').css({'background-color': '#ffe', 'padding': '0 0 0 0' , 'margin': '0 0 0 0' });
$('iframe').css({'padding': '0 0 0 0' , 'margin': '0 0 0 0', 'display' : 'block' });
}
});