| Thema: |
|
||
| Autor: | JPS | ||
| Datum: | 22.02.25 18:49 | ||
| Antwort auf: | Hui indeed und haben will!!! von tikiman | ||
>Benutze allerdings Firefox...was nimmt man da, Tampermonkey? Ich benutze Vivaldi (Chromium) mit der Chrome Extension "User JavaScript and CSS", weil die JS und CSS kann und übersichtlich aufgebaut ist. Hier hatte ein Firefox User die gleiche Frage: [https://www.reddit.com/r/firefox/comments/1d9delz/looking_for_similar_extension_for_user_javascript/] >Kannste mal berichten, wie Du ChatGPT instruiert hast? Ging mehrfach hin und her. Ist wohl einfacher, wenn ich Dir den Code reinkopiere, dann kannst Du ChatGPT immer noch darauf aufsetzen lassen, wenn Du etwas anders gelöst haben willst: Darkmode (CSS): body { background-color: #2c2c2c; color: #d0d0d0 } .bg1, .bg2 { background-color: #3d3d3d; color: #d0d0d0 } A:link { color: #87cce6; } a:visited { color: #87e6a8 } td, th { background-color: #353535; } span { color: #d0d0d0 !important; } #norm { color: #d0d0d0; } .highlight { color: #ec5959 !important; } .boardlist { color: #e6e387 !important; } .currentboard { color: #e6e387 !important; } .own a { color: #e6e387 !important; } #quicksearchtext { background: #d0d0d0; color: #2c2c2c; } input { accent-color: #87cce6; color: #2c2c2c; background-color: #d0d0d0; } frameset, frame { border-color: #d0d0d0; color: #d0d0d0; background-color: #d0d0d0; } Frameset (JS): (function() { if (window.top === window) { var fs = document.getElementsByTagName("frameset")[0]; if (!fs) return; var frames = fs.getElementsByTagName("frame"); if (frames.length < 3) return; var topFrame = frames[0], middleFrame = frames[1], bottomFrame = frames[2]; var topSrc = topFrame.getAttribute("src"), middleSrc = middleFrame.getAttribute("src"), bottomSrc = bottomFrame.getAttribute("src"); var topName = topFrame.getAttribute("name"), middleName = middleFrame.getAttribute("name"), bottomName = bottomFrame.getAttribute("name"); var newHtml = '<!DOCTYPE html><html>' + '<head>' + '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' + '<title>M! Forum (JPS)</title>' + '<link rel="stylesheet" type="text/css" href="css/pxmboard.css"/>' + '<link rel="icon" href="https://www.maniac-forum.de/forum/favicon.ico" type="image/vnd.microsoft.icon">' + '<script type="text/javascript">window.name = "unnamed";</script>' + '</head>' + '<frameset cols="845,*" border="1" framespacing="0" frameborder="1">' + '<frameset rows="50%,*">' + '<frame src="' + topSrc + '" name="' + topName + '">' + '<frame src="' + middleSrc + '" name="' + bottomName + '">' + '</frameset>' + '<frame src="' + bottomSrc + '" name="' + middleName + '">' + '</frameset>' + '<noframes><body>Ihr Browser unterstützt keine Frames!</body></noframes>' + '</html>'; document.open(); document.write(newHtml); document.close(); } })(); Highlight in Threadlist (JS): (function() { try { // --- Configuration for own posts --- var targetUsername = "JPS"; var highlightColor = "#e6e387"; // Helper: returns the next element sibling (skips text nodes) function getNextElementSibling(node) { while (node && node.nodeType !== 1) { node = node.nextSibling; } return node; } // Function to process the threadlist for highlighting function processThreadList() { var threadlist = document.getElementById("threadlist"); if (!threadlist) return; // Get all <a> elements within the threadlist. var links = threadlist.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { var link = links[i]; var titleFont = null; var fonts = link.getElementsByTagName("font"); for (var j = 0; j < fonts.length; j++) { if (fonts[j].getAttribute("size") === "2") { titleFont = fonts[j]; break; } } if (!titleFont) continue; // Get the next element sibling after the link. var infoFont = getNextElementSibling(link.nextSibling); if (!infoFont || infoFont.tagName !== "FONT" || infoFont.getAttribute("size") !== "1") continue; var spans = infoFont.getElementsByTagName("span"); if (spans.length === 0) continue; var username = spans[0].textContent.trim(); if (username === targetUsername) { titleFont.style.color = highlightColor; titleFont.style.fontWeight = "bold"; } } } // Use MutationObserver to detect when the threadlist element is added. function observeThreadlist() { var observer = new MutationObserver(function(mutations, obs) { if (document.getElementById("threadlist")) { processThreadList(); obs.disconnect(); } }); observer.observe(document, { childList: true, subtree: true }); } if (document.getElementById("threadlist")) { processThreadList(); } else { observeThreadlist(); } } catch (e) { // Silently catch errors (or log if you need to troubleshoot) } })(); In der von mir genutzten Extension sieht das dann in etwa wie folgt aus: [https://i.imgur.com/I9yIcnV.png] [https://i.imgur.com/p2Q0v4s.png] [https://i.imgur.com/vCNyynJ.png] (wichtig ist hier, dass unten rechts "All Frames" aktiviert ist. |
|||
| < antworten > | |||