Unblock Comments

A simple script that enables a second way to comment on media and news plattforms

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        Unblock Comments
// @namespace   flxunblockcomments
// @description A simple script that enables a second way to comment on media and news plattforms 
// @include     https://*.youtube.com/watch?v=*
// @icon        https://comment.floxen.de/icon.png
// @version     3
// @grant       none
// ==/UserScript==
var loc=window.location.href||document.location.href;function extractYoutubeVideoID(url){var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;var match=url.match(regExp);if(match&&match[7].length==11){return match[7]}else{throw "Could not extract video ID."}}function elementChildren(el){var childNodes=el.childNodes,children=[],i=childNodes.length;while(i--){if(childNodes[i].nodeType==1){children.unshift(childNodes[i])}}return children}var max_wait_time_to_appear=30000;var step_wait_time_to_appear=500;var wait_time=0;function youtube_video(){var meta_box=document.querySelector("#top.style-scope.ytd-watch #container #main #meta");if(document.getElementById("comments")!==null&&meta_box!==null){var id=extractYoutubeVideoID(loc);var toggle_comments=document.createElement("button");toggle_comments.innerHTML="switch comments";toggle_comments.addEventListener("click",function(){if(document.getElementById("extraComments").style.display=="none"){document.getElementById("comments").style.display="none";document.getElementById("extraComments").style.display="inline"}else{document.getElementById("comments").style.display="inline";document.getElementById("extraComments").style.display="none"}});var framed_comments=document.createElement("iframe");framed_comments.src="https://comment.floxen.de/yt/"+id;framed_comments.style.width="100%";framed_comments.style.height="800px";framed_comments.style.display="none";framed_comments.id="extraComments";meta_box.appendChild(toggle_comments);meta_box.appendChild(framed_comments)}else{wait_time+=step_wait_time_to_appear;if(wait_time>=max_wait_time_to_appear){console.log("Comments on youtube get timeout. If you think that this is something else (layout change...). Contact Me: [email protected]")}setTimeout(youtube_video,step_wait_time_to_appear)}}if(loc.startsWith("https://www.youtube.com/watch?v=")||loc.startsWith("https://youtube.com/watch?v=")){youtube_video()}