Xhamster - Delete Extra Big space in comments / Blogs v.1

Delete Extra Big space in comments / Blog

이 스크립트를 설치하려면 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            Xhamster - Delete Extra Big space in comments / Blogs v.1
// @version         v.1.00
// @description	    Delete Extra Big space in comments / Blog
// @icon            https://external-content.duckduckgo.com/ip3/fr.xhamster.com.ico
// @namespace       https://greasyfork.org/fr/users/7434-janvier56
// @homepage        https://greasyfork.org/fr/users/7434-janvier56
// @match           https://*.xhamster.com/*
// @grant           none
// ==/UserScript==

(function() {
  'use strict';
  var comments = document.querySelectorAll('.video-page .width-wrap .comments-section.comments-container #commentBox [class^="commentsList-"] [class^="commentItem-"] [class^="text-"]  [class^="commentText-"]');
  comments.forEach(function(comment) {
    var brs = comment.getElementsByTagName('br');
    var i = 0;
    while (i < brs.length - 1) {
      if (brs[i].nextSibling === brs[i + 1]) {
        brs[i + 1].remove();
      } else {
        i++;
      }
    }
  });

  var storyTexts = document.querySelectorAll('.story-section .story-item .story-text:not(.xh-editor)');
  storyTexts.forEach(function(storyText) {
    var brs = storyText.getElementsByTagName('br');
    var i = 0;
    while (i < brs.length - 1) {
      if (brs[i].nextSibling === brs[i + 1]) {
        brs[i + 1].remove();
      } else {
        i++;
      }
    }
  });
})();