// ==UserScript==
// @name SafeTwip
// @namespace http://github.com/R3turn-Dev/SafeTwip
// @version 1.1
// @description Twip AlertBox에 영상도네 미리보기 기능을 추가해줍니다.
// @author R3turn-Dev @return0927
// @match https://twip.kr/widgets/alertbox/*
// @grant none
// @updateURL http://virtly.return0927.xyz:88/lastest.user.js
// ==/UserScript==
!function(){"use strict";$("body").prepend("
"),$("head").append("");var e=$("iframe#ytplayer");var i=!1,t=null,a=!1;console.log("영상도네: "+i),$("#safe_twip_skip").on("click",function(){(a=!a)?($("#safe_twip_skip").html("Skip&Pause"),$("#safe_twip_vid").empty(),$("#safe_twip_vid").append(""),i=!1,!1,t=null):$("#safe_twip_skip").html("Resume")}),setInterval(function(){try{A.mediaInfo!==t&&(i=Boolean(A.mediaInfo),t=A.mediaInfo,console.log("영상도네: "+i))}catch(e){}},50),setInterval(function(){a||(i?"youtube"==A.mediaInfo.type&&54==$("#safe_twip_vid").html().length&&($("#safe_twip_vid").empty(),$("#safe_twip_vid").append(""),console.log("Append "+$("#safe_twip_vid").html().length)):54!=$("#safe_twip_vid").html().length&&($("#safe_twip_vid").empty(),$("#safe_twip_vid").append(""),console.log("Empty")))},50),setInterval(function(){console.log(.6*window.innerWidth+" "+.6*window.innerWidth*.5625),console.log(e.width()+" "+e.height()),e.width(.6*window.innerWidth),e.height(.5625*e.width)},1e3)}();