Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name BBS non-HTML Post Link Fix
- // @namespace dollars-bbs.org
- // @author Degritone
- // @description Fixes incorrectly formatted >> links
- // @match *://*.dollars-bbs.org/*
- // @grant none
- // ==/UserScript==
- function work(loaded){
- let replies = document.getElementsByClassName("replytext");
- if(!replies){
- setTimeout(work,100,false);
- return;
- }
- if(!loaded){
- setInterval(work,400,true);
- return;
- }
- for(let i=0;i<replies.length;i++){
- let as = replies[i].getElementsByTagName("a");
- for(let j=0;j<as.length;j++){
- if(as[j].href.startsWith("https://dollars-bbs.org") && as[j].href.includes("kareha.pl")){
- as[j].href = as[j].href.replace(/kareha\.pl/,"res");
- as[j].href = as[j].href.replace(/\/(?=[0-9]+$)/,".html#");
- }
- }
- }
- }
- work(false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement