Danbooru: Notes display without mouse hover

This script displays the contents of notes on Danbooru within the hover box so you don't have to hover over them to see anything.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Danbooru: Notes display without mouse hover
// @namespace    dbmod.io
// @version      0.3.2
// @description  This script displays the contents of notes on Danbooru within the hover box so you don't have to hover over them to see anything.
// @author       FPX
// @match        https://danbooru.donmai.us/posts/*
// @match        http://danbooru.donmai.us/posts/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    function loadNotes() {
        var noteBodies = document.getElementsByClassName("note-body");
        var attempts = 0;
        while (noteBodies.length === 0) {
            noteBodies = document.getElementsByClassName("note-body");
            attempts++;
            if (attempts == 200) {
                break;
            }
        }
        var noteBoxes = document.getElementsByClassName("note-box");
        for (var i=0; i<noteBodies.length; i++) {
            var id = noteBodies[i].getAttribute("data-id");
            var width = noteBodies[i].style.minWidth;
            var data = noteBodies[i].innerHTML;
            for (var j=0; j<noteBoxes.length; j++) {
                var id2 = noteBoxes[j].getAttribute("data-id");
                if (id2 == id) {
                    noteBoxes[j].style.height = "auto";
                    noteBoxes[j].style.width = Math.max(noteBoxes[j].style.width, width);
                    noteBoxes[j].children[2].style.fontSize = "0.8em";
                    noteBoxes[j].children[2].style.wordWrap = "break-word";
                    noteBoxes[j].children[2].style.opacity = "1.0";
                    noteBoxes[j].children[2].style.background = "rgba(255, 255, 238, 0.875)";
                    noteBoxes[j].children[2].style.width = width;
                    noteBoxes[j].children[2].style.height = "auto";
                    noteBoxes[j].children[2].innerHTML = data/*.replace(/<[^>]*>/g, "")*/;
                }
            }
        }
    }
    setTimeout(loadNotes, 100);
})();