Reformat Post Permalinks - deltaruneboards.net

Turns "Posted on:" links in post headers into normal working permalinks. 2025-11-22

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Reformat Post Permalinks - deltaruneboards.net
// @namespace    https://greasyfork.org/en/users/766248-snarp
// @version      0.5
// @description  Turns "Posted on:" links in post headers into normal working permalinks. 2025-11-22
// @author       snarp
// @match        https://deltaruneboards.net/*
// ==/UserScript==

/*

This userscript reformats post permalinks to look like this:

    <a title="Permalink" href="#entry92157" style="text-decoration:underline">Posted on:</a>

By default, they look like this:

    <a title="" href="#" onclick="link_to_post(92157); return false;" style="text-decoration:underline">Posted on:</a>

Clicking one does not set the browser URL to a working permalink URL. It 
instead opens a dialog allowing the user to manually copy a URL in this format:

    https://deltaruneboards.net/index.php?showtopic=2938&view=findpost&p=92157

Which, when entered into the browser address bar, will redirect to:

    https://deltaruneboards.net/index.php?showtopic=2938&st=90&#entry92157

This is unexpected behavior that makes acquiring the permalink more 
time-consuming than using built-in browser methods (right-clicking and 
selecting 'Copy link' or left-clicking and copying from the browser address 
bar).

*/

(function() {
  'use strict';

  function reformatPostPermalinks() {
    for (const pdiv of document.querySelectorAll("div.post-normal")) {
      // post ID is stored in a node directly before the post div: `<a name="entry92157"></a>`
      let pid = pdiv.previousElementSibling.getAttribute('name');
      let plink = pdiv.querySelector('span.postdetails a');
      plink.setAttribute('href', '#'+pid);
      plink.setAttribute('title', 'Permalink');
      plink.removeAttribute('onclick');
    }
  }

  reformatPostPermalinks();

})();