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.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
})();