// ==UserScript== // @name dlsite title reformat // @namespace https://github.com/x94fujo6rpg/SomeTampermonkeyScripts // @version 0.94.0 // @description remove title link / remove excess text / custom title format / click button to copy // @author x94fujo6 // @match https://www.dlsite.com/* // @run-at document-idle // @grant GM_getValue // @grant GM_setValue // @homepageURL https://github.com/bearpool/SomeTampermonkeyScripts // @supportURL https://github.com/bearpool/SomeTampermonkeyScripts // @updateURL https://raw.githubusercontent.com/bearpool/SomeTampermonkeyScripts/fix/dlsite-title-reformat-2026/dlsite_title_reformat.user.js // @downloadURL https://raw.githubusercontent.com/bearpool/SomeTampermonkeyScripts/fix/dlsite-title-reformat-2026/dlsite_title_reformat.user.js // ==/UserScript== /* dlsite title reformat - continuation build Original script (0.92) by x94fujo6: https://greasyfork.org/scripts/416179-dlsite-title-reformat https://github.com/x94fujo6rpg/SomeTampermonkeyScripts That repository was archived on 2026-10-27 and DLsite replaced the server-rendered product page with a Nuxt build, which broke the script. This build keeps the original formatter, settings UI and GM keys, and only rewrites the site adapters so existing installs keep their saved format. @name and @namespace are unchanged on purpose: Tampermonkey treats them as the script identity, so installing this replaces 0.92 in place instead of sitting next to it. */ /* jshint esversion: 9 */ // --------------------------------------------------------------------------- // v0.93 - adapt to DLsite's 2026 Nuxt-rendered pages // // The site migrated the product page away from the old server-rendered markup // (and away from the inline `var contents = {...}` global) to Nuxt SSR. // Everything that read `contents`, `#work_maker`, `#work_right_inner`, // `.work_tracklist`, `.main_genre` or `#_link_RJ...` therefore stopped working. // // This version keeps the formatting engine and the settings UI identical and // rewrites only the site adapters. Old selectors are still tried last, so the // script keeps working if a page is served by the legacy renderer (touch site, // A/B rollback, ...). // --------------------------------------------------------------------------- (function () { 'use strict'; const SCRIPT = '[dlsite title reformat]'; const VERSION = '0.94.0'; const debug = /[?&]dtr_debug=1/.test(location.search); //----------------------------------------------------- settings (same keys as 0.92) const key_format = "format_seting"; const key_adv = "format_adv"; const key_f2h = "format_f2h"; const key_show_ot = "format_show_ot"; const key_show_ft = "format_show_ft"; const key_sep = "format_sep"; const default_format = "%id% %title_formatted%"; const default_adv = false; const default_f2h = true; const default_half = "1234567890()[]{}~!@#$%^&_+-=;':,.()~"; const default_full = "1234567890()[]{}~!@#$%︿&_+-=;’:,.()〜"; const default_show_ot = true; const default_show_ft = true; const default_sep = "、"; const GM_get = (k, d) => { try { return (typeof GM_getValue === "function") ? GM_getValue(k, d) : d; } catch (e) { return d; } }; const GM_set = (k, v) => { try { if (typeof GM_setValue === "function") GM_setValue(k, v); } catch (e) { /* ignore */ } }; let setting_format = GM_get(key_format, default_format); let setting_adv = GM_get(key_adv, default_adv); let setting_f2h = GM_get(key_f2h, default_f2h); let setting_half = default_half; let setting_full = default_full; let setting_show_ot = GM_get(key_show_ot, default_show_ot); let setting_show_ft = GM_get(key_show_ft, default_show_ft); let setting_sep = GM_get(key_sep, default_sep); let formatted_data = { id: "", title_original: "", title_formatted: "", circle: "", Year: "", year: "", month: "", day: "", series: "", author: "", scenario: "", illust: "", cv: "", age: "", type: "", tags: "", }; let data_list = Object.keys(formatted_data); const forbidden = `<>:"/|?*\\`; const replacer = `<>:”/|?*\`; //----------------------------------------------------- formatting engine (unchanged from 0.92) const container_list = [ "()", "[]", "{}", "()", "<>", "[]", "{}", "【】", "『』", "《》", "〈〉", "「」", ]; const regesc = t => t.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); const [container_start, container_end] = extracContainer(); const reg_container = containerRegexGenerator(); const reg_excess = new RegExp(`^\\s*${reg_container}\\s*|\\s*${reg_container}\\s*$`, "g"); const reg_blank = /[\s ]{2,}/g; const reg_muti_blank = /[\s \n\t]+/g; const reg_ascii = /[\x00-\x7F]/g; const reg_until_number = /[^\d]*[\d]+/; const reg_time = new RegExp(`[${regesc(container_start)}]*(\\d+:\\d+|約\\d*時*間*\\d+分\\d*秒*|合*計*\\d+分\\d+秒|\\d+時間\\d+分\\d*秒*)[${regesc(container_end)}]*`, "g"); const reg_non_word_at_start = /^[\u0021-\u002f\u003a-\u0040\u005b-\u0060\u007b-\u007e\uff5f-\uff63 \s]/; const reg_text_start = /^(銉堛儵銉冦偗|track)/; const reg_non_track = /(?<=[mM][pP]|[kK][uU])\d+|\d*\.*\d+(?=[kK][bB]|[kK][hH][zZ]|[bB][iI][tT]|[dD][iI][oO])/g; const reg_non_track2 = /([mM][pP]|[kK][uU])\d+|\d*\.*\d+([kK][bB]|[kK][hH][zZ]|[bB][iI][tT]|[dD][iI][oO])/g; const max_depth = 10; //----------------------------------------------------- tiny DOM helpers const qs = (sel, root) => (root || document).querySelector(sel); const qsa = (sel, root) => Array.from((root || document).querySelectorAll(sel)); const text = el => (el ? (el.textContent || "") : ""); const clean = el => text(el).replace(reg_muti_blank, " ").trim(); const num = v => (Number.isFinite(+v) ? +v : 0); function debug_msg(...any) { if (debug) console.log(SCRIPT, ...any); } // A single always-on line so "did the script even run here" is answerable // without guessing. Everything else stays quiet unless ?dtr_debug=1. let reported = {}; function reportOnce(key, detail) { if (reported[key]) return; reported[key] = true; if (detail === undefined) console.log(SCRIPT, key); else console.log(SCRIPT, key, detail); } function warn(e) { console.warn(SCRIPT, "error:", e && e.message ? e.message : e); } // Legacy pages keep the old CSS but the markers are gone; helpers below // therefore always try the modern selector first and fall back to the old. function firstNode(...selectors) { for (const sel of selectors) { if (!sel) continue; const el = qs(sel); if (el) return el; } return null; } //----------------------------------------------------- boot // Always defer by one task. With @run-at document-idle (the default) the // script body is evaluated while the page is already "complete", so calling // boot() synchronously here would run every top-level `const` declared // further down in the temporal dead zone ("Cannot access 'KEYS' before // initialization"). Deferring also keeps us behind the initial parse. function scheduleBoot() { setTimeout(() => { try { boot(); } catch (e) { warn(e); } }, 0); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", scheduleBoot, { once: true }); } else { scheduleBoot(); } function boot() { try { const link = location.href; if (!document.body) return; reportOnce("loaded", `v${VERSION} on ${location.pathname}`); // only the work detail page, not cart / wishlist / announce pages that // happen to carry the same product_id in the query if (/\/work\/=\/product_id\//.test(link) && !/\/announce\//.test(link)) { myCss(); whenReady(() => !!(document.getElementById("work_name") || qs(".c-productInfo__item")), () => { try { productHandler(); } catch (e) { warn(e); } }); fix_switch_link(); return; } if (/\/announce\/list/.test(link)) { reportOnce("announce page"); wait_for_fav(); return; } if (/\/fsr|\/genres\/works|\/circle\/profile|\/works\/type|\/works\//.test(link)) { myCss(); whenReady(() => !!qs("[data-list_item_product_id]"), () => { try { searchHandler(); } catch (e) { warn(e); } }); fix_switch_link(); return; } reportOnce("not in support list", location.pathname); } catch (e) { warn(e); } } function warn(e) { console.warn(SCRIPT, "error:", e && e.message ? e.message : e); } function whenReady(test, run, { interval = 250, timeout = 10000, tries = 0 } = {}) { if (test()) { run(); return; } if (tries * interval >= timeout) { debug_msg("wait timeout"); return; } setTimeout(() => { try { if (test()) run(); else whenReady(test, run, { interval, timeout, tries: tries + 1 }); } catch (e) { warn(e); } }, interval); } function extracContainer() { let start = "", end = ""; container_list.forEach(c => { start += c[0]; end += c[1]; }); return [start, end]; } function containerRegexGenerator() { let reg = []; container_list.forEach(c => { let esc = regesc(c); let end = esc.slice(esc.length / 2); let start = esc.replace(end, ""); reg.push(`${start}[^${esc}]*${end}`); }); return `(${reg.join("|")})`; } //----------------------------------------------------- product page: data function productIdFromUrl() { const m = location.href.match(/\/([A-Z]{2}\d{4,})\.html/); if (m) return m[1]; const el = firstNode("[data-product_id]", "[data-product-id]"); const v = el && (el.getAttribute("data-product_id") || el.getAttribute("data-product-id")); return v || ""; } function productTitle() { const h1 = document.getElementById("work_name"); if (h1) { const t = clean(h1); if (t) return t; } const ld = ldJsonProduct(); if (ld && ld.name) return String(ld.name); const og = qs('meta[property="og:title"]'); if (og) { // "銆?0%OFF銆慞ray Game [U-ROOM] | DLsite" -> "Pray Game" let t = og.getAttribute("content") || ""; t = t.replace(/\s*\|\s*DLsite.*$/, "").replace(/^【[^】]*】/, "").trim(); t = t.replace(/\s*\[[^\]]*\]\s*$/, "").trim(); if (t) return t; } return ""; } function ldJsonProduct() { for (const s of qsa('script[type="application/ld+json"]')) { try { const j = JSON.parse(s.textContent); if (j && j["@type"] === "Product") return j; } catch (e) { /* ignore */ } } return null; } // key -> value map from the modern spec table, with all known locales function specMap() { const map = new Map(); qsa(".c-productInfo__item").forEach(item => { const k = clean(qs(".c-productInfo__key", item)); const v = qs(".c-productInfo__value", item); if (!k || !v) return; map.set(k.replace(reg_muti_blank, ""), v); }); return map; } const KEYS = { circle: ["サークル名", "サークル", "社团名", "社團名", "Circle"], date: ["販売日", "发售日", "發售日", "Release date"], series: ["シリーズ名", "系列名", "Series name"], author: ["作者", "Author"], scenario: ["シナリオ", "剧情", "劇本", "Scenario"], illust: ["イラスト", "插画", "插畫", "Illustration"], cv: ["声優", "声优", "聲優", "Voice Actor"], age: ["年齢指定", "年龄指定", "年齡指定", "Age"], type: ["作品形式", "Product format"], genre: ["ジャンル", "分类", "分類", "Genre"], }; function specValue(map, kind) { for (const alias of KEYS[kind]) { const hit = map.get(alias.replace(reg_muti_blank, "")); if (hit) return hit; } return null; } // value element -> plain text of the "real" content, skipping icon chips function specPlain(el) { if (!el) return ""; const parts = qsa("a", el).map(a => clean(a)).filter(Boolean); if (parts.length) return parts.join(setting_sep).trim(); const spans = qsa("span:not([class*='label_']):not([class*='icon_'])", el) .map(s => clean(s)).filter(Boolean); if (spans.length) return spans.join(setting_sep).trim(); return clean(el); } function parseDate(rawText) { if (!rawText) return null; const m = rawText.match(/(\d{4})\D{0,3}(\d{1,2})\D{0,3}(\d{1,2})/); if (!m) return null; return { Y: m[1], m: String(m[2]).padStart(2, "0"), d: String(m[3]).padStart(2, "0") }; } function specDate(map) { const v = specValue(map, "date"); const parsed = parseDate(clean(v)); if (parsed) return parsed; // fallback: any element in the spec table that looks like a date for (const [, el] of map) { const p = parseDate(clean(el)); if (p) return p; } return null; } function coverUrl(id) { const og = qs('meta[property="og:image"]'); if (og) { const c = og.getAttribute("content"); if (c) return c.replace(/^\/\//, "https://"); } const ld = ldJsonProduct(); if (ld && Array.isArray(ld.image) && ld.image[0]) return ld.image[0]; if (ld && typeof ld.image === "string") return ld.image; const img = id ? qs(`img[src*="${id}_img_main"]`) : null; if (img) return toFullSizeImage(img.src); return ""; } const toFullSizeImage = url => String(url || "").replace(/(.*)resize(.*)_\d+x\d+(.*)/, "$1modpub$2$3"); // One small copy button for the spec table: shows what it copies, so the // Spec-table copy button. 0.92 rendered a plain "Copy" here; keep that look // (the copied value is in the tooltip + dataset, not the label). The date // row is the exception and passes an explicit label, because two unlabelled // buttons side by side are impossible to tell apart. function newSpecButton(copytext, label = "Copy") { const btn = newCopyButton(copytext, label); btn.classList.add("dtr_spec_btn"); return btn; } //----------------------------------------------------- product page: handler function getData() { const map = specMap(); const id = productIdFromUrl(); const name = productTitle(); const date = specDate(map); let circle = clean(qs("a.c-productInfo__makerName")); if (!circle) circle = specPlain(specValue(map, "circle")); if (!circle) circle = clean(qs("#work_maker span.maker_name a")); if (!circle) { const ld = ldJsonProduct(); circle = ld && ld.brand && ld.brand.name ? String(ld.brand.name) : ""; } const pick = kind => { const el = specValue(map, kind); return el ? stringFormatter(specPlain(el)) : ""; }; Object.assign(formatted_data, { id: id, title_original: name, title_formatted: stringFormatter(name), circle: stringFormatter(circle), Year: date ? date.Y : "", year: date ? date.Y.slice(2) : "", month: date ? date.m : "", day: date ? date.d : "", series: pick("series"), author: pick("author"), scenario: pick("scenario"), illust: pick("illust"), cv: pick("cv"), age: pick("age"), type: pick("type"), }); const genreEl = specValue(map, "genre"); let tags = genreEl ? qsa("a[href*='/fsr/=/genre/']", genreEl).map(a => clean(a)) : []; if (!tags.length) tags = qsa(".main_genre a, [class*='genre'] a[href*='/fsr/=/genre/']").map(a => clean(a)); if (!tags.length) tags = qsa("a[href*='/fsr/=/genre/']").map(a => clean(a)); tags = Array.from(new Set(tags.filter(Boolean))); formatted_data.tags = stringFormatter(tags.join(setting_sep)); // copy buttons inside the spec table qsa(".c-productInfo__item").forEach(item => { const k = clean(qs(".c-productInfo__key", item)); const v = qs(".c-productInfo__value", item); if (!k || !v) return; if (v.querySelector(".dtr_spec_btn")) return; // already decorated const kk = k.replace(reg_muti_blank, ""); const isDate = KEYS.date.some(x => x.replace(reg_muti_blank, "") === kk); if (isDate) { if (!date) return; // wrap each date in its own labelled button so they can never // run together into "2611212012..." again const ymd = `${date.Y}${date.m}${date.d}`; const ymd2 = `${date.Y.slice(2)}${date.m}${date.d}`; const group = document.createElement("span"); group.className = "dtr_spec_group"; // 0.92 inserted both with afterbegin, so the short form ends up // first: "190917 | 20190917". Keep that order. group.append(newSpecButton(ymd2, ymd2), newSpecButton(ymd, ymd)); v.insertAdjacentElement("afterbegin", group); return; } let value = ""; for (const kind of Object.keys(KEYS)) { if (kind === "date" || kind === "circle") continue; if (!KEYS[kind].some(x => x.replace(reg_muti_blank, "") === kk)) continue; value = formatted_data[kind]; break; } if (!value && KEYS.circle.some(x => x.replace(reg_muti_blank, "") === kk)) { value = formatted_data.circle; } if (value) { v.insertAdjacentElement("afterbegin", newSpecButton(value)); } }); debug_msg("data", Object.assign({}, formatted_data)); return formatted_data; } // Adds one styled copy button. `container` lets date rows group two buttons // inside a wrapper instead of dumping them straight into the spec value. function insertCopyButton(pos, container, copytext, btext = "Copy") { if (!pos || !copytext) return null; const btn = newCopyButton(copytext, btext); btn.classList.add("dtr_spec_btn"); const target = container || pos; target.insertAdjacentElement(container ? "beforeend" : "afterbegin", btn); if (container) pos.append(container); return btn; } function productHandler() { try { getData(); } catch (e) { warn(e); } const mount = ensureTitleBlock(); if (!mount) { debug_msg("no title mount point"); return; } // Fill (or re-fill) the block. Re-running this is safe: it rebuilds the // content from scratch, which is what has to happen after Vue hydration // or a client-side re-render wipes the node out. fillTitleBlock(mount); addTracklistIfAny(); keepTitleBlock(); reportOnce("injected"); } function fillTitleBlock(pos) { pos.textContent = ""; pos.dataset.dtrFilled = "1"; const id = formatted_data.id; const title_o = formatted_data.title_original; const title_f = formatted_data.title_formatted; const title_id_c = parseFormatString(setting_format); const title_id_o = `${id} ${title_o}`; const title_id_f = `${id} ${title_f}`; const notSame_o_c = Boolean(title_id_o !== title_id_c); const notSame_f_c_o = Boolean(title_id_f !== title_id_c && title_id_f !== title_id_o); const cover = coverUrl(id); // Readable text rows. 0.92 reused ".dtr_textsize05" (8px) for the // settings panel and I wrongly applied it to the whole block, which made // everything ~8px tall. Use real body text here. const addRow = (label, value, id) => { const row = document.createElement("div"); row.className = "dtr_row"; const tag = document.createElement("span"); tag.className = "dtr_row_label"; tag.textContent = label; const val = document.createElement("span"); val.className = "dtr_row_value"; val.style = "user-select: text;"; val.textContent = value; if (id) val.id = id; row.append(tag, val); pos.append(row); return val; }; if (cover) addRow("Cover", cover); if (notSame_o_c && setting_show_ot) addRow("Original", title_id_o); if (notSame_f_c_o && setting_show_ft) addRow("Formatted", title_id_f); addRow("Custom", title_id_c, "format_title_custom_span"); // buttons on their own line, wrapped so they stay readable const bar = document.createElement("div"); bar.className = "dtr_bar"; const addBtn = (btn) => { btn.classList.add("dtr_btn"); bar.append(btn); }; const addSep = () => { const sep = document.createElement("span"); sep.className = "dtr_sep"; sep.textContent = "|"; bar.append(sep); }; if (id) { addBtn(newCopyButton(id)); addSep(); } addBtn(newCoverDownload(id)); addSep(); addBtn(newCopyButton(cover || "no cover", "Cover(Url)")); addSep(); const custom_button = newCopyButton(title_id_c, "CustomTitle"); custom_button.id = "format_title_custom_button"; addBtn(custom_button); if (notSame_o_c && setting_show_ot) { addSep(); addBtn(newCopyButton(title_o, "Original")); addBtn(newCopyButton(title_id_o, "ID+Original")); } if (notSame_f_c_o && setting_show_ft) { addSep(); addBtn(newCopyButton(title_f, "DefaultFormat")); addBtn(newCopyButton(title_id_f, "ID+DefaultFormat")); } pos.append(bar); setting(pos); } // Insert the block that holds the formatted titles + buttons. function ensureTitleBlock() { const existing = document.getElementById("dtr_title_block"); if (existing && document.body.contains(existing)) return existing; // The title area is a flex row (h1 + share buttons). Inserting *inside* // it puts the block beside the title, so always attach after the whole // title box instead, and only fall back to narrower nodes if needed. const anchors = [ () => qs(".c-productTitleBoxPc"), () => qs(".c-productTitleBox"), () => document.getElementById("work_name") && document.getElementById("work_name").closest(".p-work__top"), () => document.getElementById("work_name") && document.getElementById("work_name").closest(".headline"), () => document.getElementById("work_name"), () => qs(".p-work__main"), ]; let anchor = null; for (const get of anchors) { try { anchor = get(); } catch (e) { anchor = null; } if (anchor) break; } if (!anchor) return null; const box = document.createElement("div"); box.id = "dtr_title_block"; box.className = "dtr_title_block"; anchor.insertAdjacentElement("afterend", box); return box; } // Vue hydration / client re-render can drop the block (or the whole title // area). Watch for that and rebuild the content, not just an empty shell. let remountCount = 0; let remountTimer = null; function keepTitleBlock() { if (keepTitleBlock.installed) return; keepTitleBlock.installed = true; try { const obs = new MutationObserver(() => { if (remountTimer) return; remountTimer = setTimeout(() => { remountTimer = null; if (document.getElementById("dtr_title_block")) return; if (remountCount >= 10) return; remountCount++; try { productHandler(); } catch (e) { warn(e); } }, 400); }); obs.observe(document.body, { childList: true, subtree: true }); // stop watching after the page settles setTimeout(() => obs.disconnect(), 60000); } catch (e) { warn(e); } } //----------------------------------------------------- settings UI (same controls as 0.92) let updateid; function setting(pos) { const button = document.createElement("button"); button.className = "dtr_btn dtr_setting_toggle"; Object.assign(button, { textContent: "Open Setting", value: "open", onclick: function () { const ele = document.getElementById("format_setting_ui"); if (!ele) return; if (this.value === "close") { ele.style.display = "none"; this.value = "open"; this.textContent = "Open Setting"; clearInterval(updateid); } else { ele.style.display = ""; this.value = "close"; this.textContent = "Close Setting"; updateid = setInterval(updateSetting, 100); } }, }); const box = document.createElement("div"); box.id = "format_setting_ui"; box.className = "dtr_setting_box"; box.style.display = "none"; pos.append(newLine()); pos.append(button); pos.append(box); // advance mode let adv = document.createElement("button"); const mode = setting_adv ? "on" : "off"; Object.assign(adv, { className: "dtr_textsize05", id: "format_title_setting_advance_model", textContent: `Advance mode: ${mode}`, value: mode, onclick: function () { const t = document.getElementById("format_title_setting"); if (this.value === "off") { Object.assign(this, { value: "on", textContent: "Advance mode: on" }); t.readOnly = false; setting_adv = true; } else { Object.assign(this, { value: "off", textContent: "Advance mode: off" }); t.readOnly = true; setting_adv = false; } } }); box.appendChild(adv); box.appendChild(newSpan(" enable this to direct edit format setting", "dtr_textsize05 dtr_setting_w_text")); appendNewLine(box); data_list.forEach(s => box.appendChild(newDataButton(`+${s}`, `%${s}%`))); appendNewLine(box); let textarea = document.createElement("textarea"); textarea.className = "dtr_textsize05 dtr_max_width"; textarea.id = "format_title_setting"; textarea.rows = 1; textarea.value = setting_format; textarea.readOnly = !setting_adv; box.appendChild(newSpan("Format setting:")); appendNewLine(box); box.appendChild(textarea); appendNewLine(box); textarea = document.createElement("textarea"); textarea.className = "dtr_textsize05 dtr_max_width"; textarea.id = "format_title_preview"; textarea.readOnly = true; textarea.rows = 1; textarea.value = parseFormatString(setting_format); box.appendChild(newSpan("Preview:")); appendNewLine(box); box.appendChild(textarea); appendNewLine(box); box.appendChild(newButton("save", saveSetting)); box.appendChild(newSeparate()); box.appendChild(newButton("default", () => { document.getElementById("format_title_setting").value = default_format; })); box.appendChild(newSeparate()); box.appendChild(newButton("clear", () => { document.getElementById("format_title_setting").value = ""; })); appendNewLine(box); appendNewLine(box); const ck_area = document.createElement("div"); ck_area.className = "dtr_setting_ck_box"; appendAll(ck_area, [newSpan("Save & Refresh to make these setting work", ""), newLine()]); let checkbox = newCheckbox(`dtr_${key_f2h}`, function () { setting_f2h = !!this.checked; }); if (setting_f2h) checkbox.checked = true; appendAll(ck_area, [checkbox, newLable(`dtr_${key_f2h}`, "Replace some half-width to full-width"), newLine()]); checkbox = newCheckbox(`dtr_${key_show_ot}`, function () { setting_show_ot = !!this.checked; }); if (setting_show_ot) checkbox.checked = true; appendAll(ck_area, [checkbox, newLable(`dtr_${key_show_ot}`, "Show Original / ID+Original"), newLine()]); checkbox = newCheckbox(`dtr_${key_show_ft}`, function () { setting_show_ft = !!this.checked; }); if (setting_show_ft) checkbox.checked = true; appendAll(ck_area, [checkbox, newLable(`dtr_${key_show_ft}`, "Show Formatted / ID+Formatted"), newLine()]); textarea = document.createElement("textarea"); textarea.className = "dtr_textsize05"; textarea.id = `dtr_${key_sep}`; textarea.rows = 1; textarea.cols = 1; textarea.value = setting_sep; textarea.style = "resize: none;"; appendAll(ck_area, [ newLable(`dtr_${key_sep}`, "Separator: "), textarea, newLable(`dtr_${key_sep}`, " for data have muti value like tags"), newLine(), ]); box.appendChild(ck_area); appendNewLine(box); box.appendChild(newSpan("data list:")); appendNewLine(box); textarea = document.createElement("textarea"); textarea.className = "dtr_textsize05"; textarea.id = "format_title_all_data"; textarea.readOnly = true; box.appendChild(textarea); listAllData(); updateSetting(); } function updateSetting() { const s = document.getElementById("format_title_setting"); const p = document.getElementById("format_title_preview"); const cs = document.getElementById("format_title_custom_span"); const cb = document.getElementById("format_title_custom_button"); if (!s) return; if (s.value.length > 0 && setting_format !== s.value) { setting_format = s.value; const formatted = parseFormatString(setting_format); if (cs) cs.textContent = formatted; if (p) p.value = formatted; if (cb) cb.onclick = () => copyText(formatted); } const sep = document.getElementById(`dtr_${key_sep}`); if (sep) { setting_sep = sep.value; listAllData(); } } function listAllData() { const textbox = document.getElementById("format_title_all_data"); if (!textbox) return; textbox.value = ""; let count = 0, maxlength = 0, s; for (const key in formatted_data) { s = `%${key}%: ${formatted_data[key]}\n`; textbox.value += s; count++; if (formatted_data[key] && s.length > maxlength) maxlength = s.length; } // cols/rows are only hints now that CSS controls the box; keep the cols // value sane so a long tag list does not stretch the whole panel. textbox.rows = Math.min(count + 1, 14); textbox.cols = Math.min(maxlength << 1, 80); } function saveSetting() { if (setting_format.length > 0) GM_set(key_format, setting_format); GM_set(key_adv, setting_adv); GM_set(key_f2h, setting_f2h); GM_set(key_show_ot, setting_show_ot); GM_set(key_show_ft, setting_show_ft); GM_set(key_sep, setting_sep); debug_msg("settings saved"); } function parseFormatString(string = "") { let formatted_text = string; data_list.forEach(key => { formatted_text = formatted_text.replace(new RegExp(`%${key}%`, "g"), formatted_data[key] || ""); }); return repalceForbiddenChar(formatted_text); } function stringFormatter(t) { let s = removeExcess(t); if (setting_f2h) s = toHalfWidth(s); return repalceForbiddenChar(s); } function removeExcess(t) { let o_text = t; let count = 0; while (count < 100 && t.match(reg_excess)) { t = t.replace(reg_excess, ""); count++; } if (t.length === 0) t = o_text; count = 0; while (count < 100) { const index_start = container_start.indexOf(t[0]); if (index_start !== -1) { if (container_end[index_start] === t[t.length - 1]) { t = t.slice(1, t.length - 1).trim(); } else if (!t.includes(container_end[index_start])) { t = t.slice(1).trim(); } } const index_end = container_end.indexOf(t[t.length - 1]); if (index_end !== -1) { if (!t.includes(container_start[index_end])) { t = t.slice(0, t.length - 1).trim(); } } if (index_start === -1 && index_end === -1) break; count++; if (!t) break; } t = t.replace(reg_blank, " "); return t.length > 0 ? t : o_text; } function toHalfWidth(t) { for (const i in setting_full) { t = t.replace(new RegExp(setting_full[i], "g"), setting_half[i]); } return t; } function repalceForbiddenChar(t) { for (const index in forbidden) { t = t.replace(new RegExp(regesc(forbidden[index]), "g"), replacer[index]); } return t; } //----------------------------------------------------- listing pages function searchHandler() { setRefreshPage(); const rows = qsa("tr[data-list_item_product_id]"); const items = qsa("li[data-list_item_product_id]"); debug_msg(`list rows: ${rows.length}, grid items: ${items.length}`); if (rows.length) listHandler(rows); if (items.length) gridHandler(items); addSortButton(); } function itemId(el) { return el.getAttribute("data-list_item_product_id") || ""; } function itemCover(id, scope) { if (!id) return ""; const html = scope ? scope.innerHTML : ""; const mod = html.match(/\/\/img\.dlsite\.jp\/modpub\/images2\/work\/[^'"]+?_img_main\.(?:jpg|png|webp)/i); if (mod) return "https:" + mod[0]; // lazy components keep the full url in :thumb-candidates / :src const cand = scope ? qs("[thumb-candidates]", scope) || qs("[thumb_candidates]", scope) : null; if (cand) { const raw = cand.getAttribute(":thumb-candidates") || cand.getAttribute("thumb-candidates") || ""; const m = raw.match(/\/\/img\.dlsite\.jp\/resize\/images2\/work\/[^'",]+?_\d+x\d+\.(?:jpg|png|webp)/i); if (m) return "https:" + toFullSizeImage(m[0]); } if (scope) { for (const img of qsa("img", scope)) { const src = img.getAttribute("src") || ""; if (src && !/^data:/.test(src) && id && src.includes(id)) return toFullSizeImage(src.startsWith("//") ? "https:" + src : src); } } return ""; } function listHandler(rows) { rows.forEach(tr => { const pos = tr.querySelector("dl"); if (!pos) return; if (pos.querySelector(".dtr_row_box")) return; const id = itemId(tr); const title_o_text = clean(pos.querySelector(".work_name a")) || clean(pos.querySelector(".work_name")); if (!id || !title_o_text) return; const title_f_text = stringFormatter(title_o_text); const circle_text = stringFormatter(clean(pos.querySelector(".maker_name a"))); const cover = itemCover(id, tr); const node_list = [ newLine(), newCopyButton(title_o_text), newLine(), newCopyButton(title_f_text), newLine(), newCopyButton(id), newSeparate(), newCoverDownload(id, cover), newSeparate(), newCopyButton(cover || "no cover", "Cover(Url)"), newSeparate(), newCopyButton(circle_text), ]; if (title_o_text === title_f_text) node_list.splice(3, 2); const newbox = appendAll(document.createElement("dd"), node_list); newbox.className = "dtr_row_box"; const cv = pos.querySelector(".author"); const tags = pos.querySelector(".search_tag"); const cvText = cv ? stringFormatter(getMultipleDataToList(cv)) : ""; const tagText = tags ? stringFormatter(getMultipleDataToList(tags)) : ""; if (cvText) appendAll(newbox, [newSeparate(), newCopyButton(cvText, "CV/Author")]); if (tagText) appendAll(newbox, [newSeparate(), newCopyButton(tagText, "Tags")]); pos.appendChild(newbox); }); } function gridHandler(items) { const sortBox = qs(".sort_box"); if (sortBox && !qs(".dtr_grid_note")) { const w = document.createElement("div"); w.className = "dtr_grid_note"; w.appendChild(newSpan("Can't get full CV/Author list in grid view. If you need it, switch to list view.", "dtr_list_w_text")); sortBox.insertAdjacentElement("afterend", w); } items.forEach(box => { if (box.querySelector(".dtr_row_box")) return; const id = itemId(box); if (!id) return; const title_o_text = clean(box.querySelector(".work_name a")) || clean(box.querySelector(".work_name")); if (!title_o_text) return; const title_f_text = stringFormatter(title_o_text); const circle_text = stringFormatter(clean(box.querySelector(".maker_name a"))); const cover = itemCover(id, box); const cv = box.querySelector(".author"); const cvText = cv ? stringFormatter(getMultipleDataToList(cv)) : ""; const node_list = [ newCopyButton(id), newLine(), newCoverDownload(id, cover), newSeparate(), newCopyButton(cover || "no cover", "Cover(Url)"), newLine(), newCopyButton(title_o_text, "Original"), newSeparate(), newCopyButton(title_f_text, "Formatted"), newLine(), newCopyButton(circle_text, "Circle"), ]; if (title_o_text === title_f_text) node_list.splice(5, 2); if (cvText) node_list.push(newSeparate(), newCopyButton(cvText, "CV/Author")); const newbox = appendAll(document.createElement("dd"), node_list); newbox.className = "dtr_row_box"; const price = box.querySelector(".work_price_wrap"); if (price) price.insertAdjacentElement("beforebegin", newbox); else box.appendChild(newbox); }); } function getMultipleDataToList(pos, type = "a") { const list = qsa(type, pos).map(e => clean(e)).filter(Boolean); return list.join(setting_sep); } function setRefreshPage() { // The show-type switch is client side now; re-run after it settles. qsa(".display_normal, .display_block").forEach(ele => ele.addEventListener("click", () => { setTimeout(() => { try { searchHandler(); } catch (e) { warn(e); } }, 1500); })); } function addSortButton() { const classname = "reSortByID"; if (qs(`.${classname}`)) return; const pos = qs(".sort_box .status_select") || qs(".sort_box"); if (!pos) return; let ele = document.createElement("div"); ele.textContent = "SortByID:"; ele.style = "margin: 8px;"; pos.appendChild(ele); ele = newButton("Descent", () => sortByID(true)); ele.className = classname; pos.appendChild(ele); ele = newButton("Ascent", () => sortByID()); ele.className = classname; pos.appendChild(ele); ele = document.createElement("div"); ele.textContent = "SortByType:"; ele.style = "margin: 8px;"; pos.appendChild(ele); ele = newButton("Descent", () => sortByType(true)); ele.className = classname; pos.appendChild(ele); ele = newButton("Ascent", () => sortByType()); ele.className = classname; pos.appendChild(ele); } function sortContainer(sample) { if (!sample) return null; if (sample.tagName === "TR") { const table = sample.closest("table"); return (table && table.tBodies[0]) || sample.parentNode; } const ul = sample.closest("ul"); return ul || sample.parentNode; } function entries() { const rows = qsa("tr[data-list_item_product_id]"); if (rows.length) return rows; return qsa("li[data-list_item_product_id]"); } function sortByID(descent = false) { const all = entries(); if (!all.length) return; const pos = sortContainer(all[0]); if (!pos) return; const list = all.map((el, i) => ({ el, id: num(itemId(el).replace(/^[A-Za-z]+/, "")), i, })); list.sort((a, b) => (a.id - b.id) || (a.i - b.i)); if (descent) list.reverse(); list.forEach(o => pos.appendChild(o.el)); debug_msg("sorted by id", descent); } function sortByType(descent = false) { const all = entries(); if (!all.length) return; const pos = sortContainer(all[0]); if (!pos) return; const list = all.map((el, i) => { const cat = el.querySelector(".work_category"); let type = "_unknown"; if (cat && cat.classList.length) type = Array.from(cat.classList).filter(c => /^type_/.test(c)).pop() || "_unknown"; return { el, type, i }; }); list.sort((a, b) => String(a.type).localeCompare(String(b.type)) || (a.i - b.i)); if (descent) list.reverse(); list.forEach(o => pos.appendChild(o.el)); debug_msg("sorted by type", descent); } //----------------------------------------------------- announce (wishlist) page function wait_for_fav(max_retry = 10) { const list = qs(".n_worklist"); if (!list) return debug_msg("announce: list not found"); const hasCount = () => qsa(".n_worklist_item").some(item => /\d/.test(text(item.querySelector(".work_sales_info")))); const step = () => { if (hasCount() || max_retry <= 0) return setTimeout(sort_ann_list, 300); max_retry--; setTimeout(step, 700); }; step(); } function sort_ann_list() { const container = qs(".n_worklist"); if (!container) return; const items = qsa(".n_worklist_item", container); if (!items.length) return; let withCount = 0; const data = items.map((i, index) => { const likesEl = i.querySelector(".work_sales_info"); const digits = (text(likesEl).match(/\d[\d,]*/) || [""])[0].replace(/,/g, ""); if (digits) withCount++; const type = i.querySelector(".work_category"); return { item: i, index, likes: digits ? parseInt(digits, 10) : 0, type: type && type.classList.length ? (Array.from(type.classList).filter(c => /^type_/.test(c)).pop() || "_unknown") : "_unknown", }; }); if (withCount === 0) { debug_msg("announce: wishlist counts unavailable, sorting by type only"); } else { data.sort((a, b) => (b.likes - a.likes) || (a.index - b.index)); } data.sort((a, b) => String(a.type).localeCompare(String(b.type)) || (a.index - b.index)); data.forEach(i => container.appendChild(i.item)); } //----------------------------------------------------- track list function descriptionBlocks() { const inner = qs(".c-productInfo__inner"); if (inner) { const blocks = qsa(".c-productContent__text", inner); if (blocks.length) return blocks; } const legacy = qs(".work_parts_container"); return legacy ? [legacy] : []; } function descriptionLines() { const blocks = descriptionBlocks(); const lines = []; blocks.forEach(block => { const html = block.innerHTML || ""; const parts = html.split(//i); parts.forEach(part => { const div = document.createElement("div"); div.innerHTML = part; const t = (div.textContent || "").replace(reg_muti_blank, " ").trim(); if (t) lines.push(t); }); }); return lines; } function addTracklistIfAny() { const lines = descriptionLines(); if (!lines.length) return; const results = extractTrackListFromText(lines); if (!results || !results.length) return; // On audio works a two line list is normal. Elsewhere the description is // full of numbered prose ("HCG13種", "アニメ14種") that trivially looks // like a track list, so ask for a clearly numbered block instead. const minTracks = isAudioWork() ? 2 : 5; const usable = results.filter(r => r.length >= minTracks); if (!usable.length) return debug_msg(`track list: nothing convincing (need ${minTracks}+ lines)`); usable.reverse().forEach((result, index) => { try { addTracklist(result, "Extract from article (Less accurate. Can't get the track that has no number.)", index); } catch (e) { warn(e); } }); } function isAudioWork() { const type = `${formatted_data.type} ${formatted_data.tags}`; if (/銉溿偆銈箌ASMR|闊冲0|銈兗銉囥偅銈獆銈点偊銉炽儔|銉熴儱銉笺偢銉冦偗|Voice|Audio|Sound|Music|Drama/i.test(type)) return true; const wt = qs("a[href*='/work_type/']"); const code = wt && (wt.getAttribute("href") || ""); return /work_type\/(SOU|MUS|AMT)/.test(code); } function addTracklist(list, from, index = 0) { let textlist = removeExcessInTrackList(list); if (!textlist.length || textlist.some(line => line === "")) return debug_msg("found empty line, abort"); if (textlist.every(line => /^\d/.test(line))) { textlist = textlist.sort((a, b) => a.localeCompare(b, navigator.languages && navigator.languages[0] || navigator.language || "ja", { numeric: true })); } textlist = textlist.map((line, i) => `${i + 1}. ${line}`); const row_count = textlist.length; const maxlength = Math.max(...textlist.map(t => trueLength(t))); const joined = textlist.join("\n"); const hash = hashSync(joined); if (qs(`[hash="${hash}"]`)) return debug_msg(`duplicate track list [${hash}], skipped`); const box = document.createElement("div"); box.className = "dtr_tracklist"; box.setAttribute("hash", hash); const textbox = document.createElement("textarea"); textbox.id = `dtr_tracklist${index}`; textbox.rows = Math.min(row_count + 1, 40); textbox.cols = Math.min(maxlength, 120); textbox.value = joined; const copyall = newButton("Copy", () => copyText(joined)); const span = newSpan(from); if (from !== "Official") span.className = "dtr_setting_w_text"; const pos = qs(".c-productInfo__inner") || qs(".p-work__main") || qs("#work_right_inner"); if (!pos) return; pos.insertAdjacentElement("afterbegin", box); appendAll(box, [textbox, newLine(), copyall, newLine(), span]); } function trueLength(string = "") { let length = 0; [...string].forEach(char => { length += /[\w\s_]/.test(char) ? 1 : 2; }); return length; } function hashSync(string) { let h = 0x811c9dc5; for (let i = 0; i < string.length; i++) { h ^= string.charCodeAt(i); h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0; } return h.toString(16); } function removeExcessInTrackList(list = [], no_index = false) { if (!list) return []; const reglist = [reg_time, reg_text_start, reg_non_word_at_start, reg_text_start]; let new_list = doRegList(list, reglist, no_index); const have2index = /\d+\D+(?=\d+)/; if (new_list.length && new_list.every(line => line.match(have2index))) { new_list = doRegList(new_list, [have2index], no_index); } return new_list; function doRegList(_datalist, _reglist = [], _no_index = false) { const _new_list = []; const _reg_total = /绶廩^鏅傞枔]*鏅傞枔/; _datalist.forEach(_line => { let _new_line = _line; _reglist.forEach(reg => { _new_line = _new_line.replace(reg, "").trim(); }); _new_line = removeBracket(_new_line); _new_line = _new_line.replace(reg_muti_blank, " ").trim(); if (_no_index) _new_line = _new_line.replace(reg_muti_blank, "").replace(/^\d+/, "").trim(); if (!_line.match(_reg_total)) _new_list.push(_new_line); }); return _new_list; } function removeBracket(t = "") { if (!t) return t; let index = container_start.indexOf(t[0]); if (index !== -1) { if (container_end[index] === t[t.length - 1]) t = t.slice(1, t.length - 1).trim(); else if (!t.includes(container_end[index])) t = t.slice(1).trim(); } else { index = container_end.indexOf(t[t.length - 1]); if (index !== -1 && !t.includes(container_start[index])) t = t.slice(0, t.length - 1).trim(); } return t; } } function extractTrackListFromText(lines) { if (!lines || !lines.length) return false; const reg_number = /[\d1234567890]+/; const newtext = lines.map(line => shiftCode(line)).filter(Boolean); if (!newtext.length) return false; const reg_prefix = /^\D+(?=\d+)/; const reg_suffix = /(?<=\d)\D/; const reg_exclude = /https*:\/\/|総再生|総時間|合計/; const reg_age = /[rR]\-*\d+/g; const extract = []; newtext.forEach((line, index) => { const t = line.replace(reg_age, "").replace(reg_non_track2, "").replace(reg_time, ""); if (reg_exclude.test(t)) return; const mine = t.match(reg_number); if (!mine) return; const prefix = t.match(reg_prefix); const suffix = t.match(reg_suffix); extract.push({ number: parseInt(mine[0], 10), text: t, o_index: index, prefix: prefix ? prefix[0] : "_no_prefix_", suffix: suffix ? suffix[0] : "_no_suffix_", }); }); if (!extract.length) return false; const extract_result = []; const pushSequence = () => { let run = []; let last = null; extract.forEach(o => { if (last !== null && o.number === last + 1) { run.push(o.text); } else { if (run.length > 1) extract_result.push(run); run = [o.text]; } last = o.number; }); if (run.length > 1) extract_result.push(run); }; pushSequence(); // also allow "1." style continuous groups by prefix grouping const groups = new Map(); extract.forEach(o => { const key = `${o.prefix}|${o.suffix}`; if (!groups.has(key)) groups.set(key, []); groups.get(key).push(o); }); groups.forEach(group => { if (group.length < 2) return; const sorted = group.slice().sort((a, b) => a.number - b.number); const ok = sorted.every((o, i) => i === 0 || o.number === sorted[i - 1].number + 1); if (ok) { const texts = sorted.map(o => o.text); const dup = extract_result.some(r => r.length === texts.length && r.every((t, i) => t === texts[i])); if (!dup && texts.length > 1) extract_result.push(texts); } }); const cleaned = []; extract_result.forEach(result => { const check = removeExcessInTrackList(result, true); if (check.some(line => line === "")) return; cleaned.push(check); }); if (!cleaned.length) return false; return cleaned.sort((a, b) => b.length - a.length); } function shiftCode(string = "") { const reg_fullwidth_code = /[\uFF01-\uFF63]/g; return string .replace(reg_fullwidth_code, m => String.fromCharCode(m.charCodeAt(0) - 0xFEE0)) .replace(reg_muti_blank, " ") .trim(); } //----------------------------------------------------- floor switching links function fix_switch_link() { try { const path = location.pathname; const m = path.match(/^\/([a-z]+)(\/.*)?$/); if (!m || !m[2] || m[2].length < 2) return; const currentPath = m[2]; const links = qsa("nav.floor-nav .nav-floor-item a[href], .floorNavLink-item a[href], .floorTab-item a[href]"); links.forEach(link => { const href = link.getAttribute("href"); if (!href || href.startsWith("http") || href === "#" || href === "/") return; if (link.dataset.dtrFixed) return; const mm = href.match(/^\/([a-z]+)\/?$/); if (!mm) return; if (mm[1] === m[1]) return; link.setAttribute("href", `/${mm[1]}${currentPath}`); link.dataset.dtrFixed = "1"; }); } catch (e) { /* cosmetic only */ } } //----------------------------------------------------- shared UI helpers function appendAll(node, nodeList) { nodeList.forEach(e => e && node.appendChild(e)); return node; } function copyText(t) { try { if (navigator.clipboard && navigator.clipboard.writeText) { return navigator.clipboard.writeText(t); } } catch (e) { /* fall through */ } try { const ta = document.createElement("textarea"); ta.value = t; ta.style = "position:fixed;top:-1000px;"; document.body.appendChild(ta); ta.select(); document.execCommand("copy"); document.body.removeChild(ta); } catch (e) { warn(e); } } function newCopyButton(copytext, btext = "") { const button = newButton(btext === "" ? copytext : btext, () => copyText(copytext)); button.title = copytext; button.dataset.dtrCopy = copytext; return button; } function newCoverDownload(id, url) { const b = newButton("Cover(DL)", () => { const target = url || coverUrl(id); if (!target) return; const rq = new XMLHttpRequest(); rq.open("GET", target, true); rq.responseType = "blob"; rq.onload = () => { try { const file_url = window.URL.createObjectURL(rq.response); let a = document.querySelector("#dtr_img_dl_url"); if (!a) { a = document.createElement("a"); a.id = "dtr_img_dl_url"; document.body.insertAdjacentElement("afterbegin", a); } a.href = file_url; a.download = (target.match(/[A-Za-z]{2}\d+[^\/]*\.(?:jpg|png|webp)/i) || [`${id}_img_main.jpg`])[0]; a.click(); window.URL.revokeObjectURL(file_url); } catch (e) { warn(e); } }; try { rq.send(); } catch (e) { warn(e); } }); b.id = "dtr_cover_dl"; return b; } function newButton(btext, onclick) { const button = document.createElement("button"); button.textContent = btext; button.onclick = onclick; return button; } function newDataButton(btext, format_string) { return newButton(btext, () => updateSettingString("format_title_setting", format_string)); } function updateSettingString(id, format_string) { const textarea = document.getElementById(id); if (!textarea) return; const list = ["year", "Year", "month", "day"]; const o = textarea.value; if (list.some(s => format_string.includes(s)) && list.some(s => o.endsWith(`%${s}%`))) { textarea.value += format_string; } else { textarea.value += ` ${format_string}`; } textarea.value = textarea.value.trim(); } function newSpan(t = "", className = "dtr_textsize05") { const span = document.createElement("span"); span.className = className; span.textContent = t; return span; } function newCheckbox(id, onclick) { const ck = document.createElement("input"); ck.type = "checkbox"; ck.id = id; ck.onclick = onclick; return ck; } function newLable(forid = "", t = "", className = "dtr_textsize05") { const label = document.createElement("label"); label.className = className; label.htmlFor = forid; label.textContent = t; return label; } function appendNewLine(ele) { ele.appendChild(document.createElement("br")); } function newLine() { return document.createElement("br"); } function newSeparate() { return newSpan(` / `); } function myCss() { if (qs("style.myCssSheet")) return; const s = document.createElement("style"); s.className = "myCssSheet"; document.head.appendChild(s); s.textContent = ` // 0.92 used 8px here, which is ~8px. Keep the compact intent but // make it legible on a normal DPI screen. .dtr_textsize05 { font-size: 12px; vertical-align: middle; } .dtr_setting_box { border: 1px solid #ced4da; border-radius: 3px; padding: 8px 12px; margin-top: 6px; font-size: 13px; line-height: 1.6; background: #fff; } .dtr_setting_box button { font-size: 12px; line-height: 1.4; padding: 2px 8px; margin: 2px 2px; border: 1px solid #ced4da; border-radius: 3px; background: #fff; cursor: pointer; } .dtr_setting_box button:hover { border-color: #d6336c; color: #d6336c; background: #fff5f7; } .dtr_setting_box textarea { font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.5; padding: 4px 6px; border: 1px solid #ced4da; border-radius: 3px; margin: 2px 0; max-width: 100%; box-sizing: border-box; } .dtr_setting_box textarea.dtr_max_width, .dtr_setting_box #format_title_all_data { width: 100%; } .dtr_setting_box #format_title_all_data { min-height: 96px; max-height: 320px; resize: vertical; } .dtr_setting_box label { margin-right: 6px; } .dtr_setting_w_text { color: red; } .dtr_max_width { width: 100%; } .dtr_list_w_text { color: red; float: right; } .dtr_setting_ck_box { border: black 2px solid; width: max-content; padding: 8px; } .dtr_tracklist { display: inline-grid; margin: 16px 16px 32px; } /* ---- title block ------------------------------------------------- Sizes are pinned with !important because dlsite ships very broad rules (body{font-size:12px}, button{...}) and its CSS can load after ours. */ .dtr_title_block { display: block !important; user-select: text; font-size: 14px !important; line-height: 1.75 !important; margin: 12px 0 20px !important; padding: 10px 14px !important; border-left: 4px solid #d6336c !important; background: #fbfbfb !important; border-radius: 4px !important; width: auto !important; max-width: 100% !important; box-sizing: border-box !important; font-family: "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif !important; color: #212529 !important; word-break: break-word !important; overflow-wrap: anywhere !important; } .dtr_title_block .dtr_row { display: flex !important; gap: 10px !important; align-items: baseline !important; flex-wrap: nowrap !important; } .dtr_title_block .dtr_row_label { flex: 0 0 auto !important; min-width: 4.5em !important; color: #7b8794 !important; font-size: 12px !important; letter-spacing: 0.02em !important; text-transform: uppercase !important; } .dtr_title_block .dtr_row_value { flex: 1 1 auto !important; min-width: 0 !important; font-size: 14px !important; color: #212529 !important; word-break: break-all !important; } .dtr_title_block .dtr_bar { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 5px !important; margin-top: 8px !important; } .dtr_title_block .dtr_btn, .dtr_title_block button { font-size: 13px !important; line-height: 1.5 !important; padding: 3px 10px !important; border: 1px solid #ced4da !important; border-radius: 4px !important; background: #fff !important; color: #212529 !important; cursor: pointer !important; white-space: nowrap !important; font-family: inherit !important; margin: 0 !important; } .dtr_title_block .dtr_btn:hover, .dtr_title_block button:hover { border-color: #d6336c !important; color: #d6336c !important; background: #fff5f7 !important; } .dtr_title_block .dtr_sep { color: #dee2e6 !important; font-size: 12px !important; } /* copy buttons injected into the product spec table */ .dtr_spec_btn { font-size: 11px !important; line-height: 1.5 !important; padding: 0 5px !important; margin-right: 4px !important; border: 1px solid #b7bed0 !important; border-radius: 3px !important; background: #fff !important; color: #333 !important; cursor: pointer !important; vertical-align: middle !important; font-family: inherit !important; white-space: nowrap !important; min-width: 34px !important; } .dtr_spec_btn:hover { border-color: #d6336c !important; color: #d6336c !important; background: #fff5f7 !important; } .dtr_spec_group { display: inline-flex !important; gap: 4px !important; margin-right: 6px !important; vertical-align: middle !important; } .dtr_row_box button { font-size: 11px; line-height: 1.4; padding: 2px 6px; margin: 0 2px; border: 1px solid #ced4da; border-radius: 3px; background: #fff; cursor: pointer; } .dtr_row_box button:hover { border-color: #d6336c; color: #d6336c; } `; } })();