Skip to content

Instantly share code, notes, and snippets.

@yutsuku
Last active February 26, 2021 11:28
Show Gist options
  • Save yutsuku/d931f39c8b426b79b930c402596eedb9 to your computer and use it in GitHub Desktop.
Save yutsuku/d931f39c8b426b79b930c402596eedb9 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Black Desert Forum - Navigation tweak
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Brings back proper anchor links in the forum
// @author [email protected]
// @match https://*.playblackdesert.com/*/Community*
// @grant none
// @run-at document-end
// @updateURL https://gist.github.com/yutsuku/d931f39c8b426b79b930c402596eedb9/raw/a724dcb8556e9992708a254944cf945355593899/Black%2520Desert%2520Forum%2520-%2520Navigation%2520tweak.user.js
// @downloadeURL https://gist.github.com/yutsuku/d931f39c8b426b79b930c402596eedb9/raw/a724dcb8556e9992708a254944cf945355593899/Black%2520Desert%2520Forum%2520-%2520Navigation%2520tweak.user.js
// ==/UserScript==
(function() {
'use strict';
const list = document.querySelectorAll('div.left_a');
list.forEach(e => {
const link = document.createElement('a');
link.href = window.location.origin + e.getAttribute('onclick')
.match(/^location\.href=\'(.+)\'/)[1];
link.classList.add(...e.classList);
const clone = e.cloneNode(true);
link.append(...e.childNodes);
e.replaceWith(link);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment