NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name YTB to Embed window
// @namespace http://fb.com/grim.reaper.slave
// @version 0.2
// @copyright 2017+ Đặng Quốc Trung (MarkiThePews)
// @description A personal script for meh, but someone might need it!
// @include *.youtube.com/watch*
// @include *.youtube.com/embed*
// @homepageURL http://fb.com/grim.reaper.slave
// @updateURL https://openuserjs.org/meta/grim.reaper.slave/YTB_to_Embed_window.meta.js
// @author Đặng Quốc Trung
// ==/UserScript==
// Last updated on 2017-03-30 (YYYY-MM-DD)
function tohopphim(e) {
var evtohop = window.event? event : e;
if (evtohop.keyCode == 88 && evtohop.ctrlKey) changeitman();
}
document.onkeydown = tohopphim;
function changeitman() {
var kiemtra = window.location.href;
substring = "watch";
var ketqua = kiemtra.includes(substring);
if (ketqua) changetoembed(); else changetonm();
}
function changetoembed() {
var s = window.location.href;
s = s.replace("watch?v=", "embed/");
window.location.replace(s);
}
function changetonm() {
var s = window.location.href;
s = s.replace("embed/", "watch?v=");
window.location.replace(s);
}