pball

Autodesk Forum Jump To First Post

Apr 16th, 2026
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.27 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name         Autodesk Forum Jump To First Post
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2026-04-16
  5. // @description  Add jump to first unread post to post title link
  6. // @author       You
  7. // @match        https://forums.autodesk.com/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=autodesk.com
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13.     'AI written code use at own risk';
  14.     'use strict';
  15.  
  16.     function process() {
  17.         document.querySelectorAll('.message-body-wrapper').forEach(wrapper => {
  18.             const unreadLink = wrapper.querySelector('.custom-tile-unread-count');
  19.             if (!unreadLink) return;
  20.  
  21.             // specifically grab the title link inside <h3>
  22.             const mainLink = wrapper.querySelector('h3 > a[href]');
  23.             if (!mainLink) return;
  24.  
  25.             if (!mainLink.href.includes('/jump-to/first-unread-message')) {
  26.                 mainLink.href = mainLink.href.replace(/\/$/, '') + '/jump-to/first-unread-message';
  27.             }
  28.         });
  29.     }
  30.  
  31.     // Run once
  32.     process();
  33.  
  34.     // Watch for dynamic content
  35.     const observer = new MutationObserver(() => process());
  36.     observer.observe(document.body, { childList: true, subtree: true });
  37. })();
Advertisement
Add Comment
Please, Sign In to add comment