Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions src/EGO MAUL Enhancement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/blankdvth/eGOScripts/blob/master/src/EGO%20MAUL%20Enhancement.ts
// @downloadURL %DOWNLOAD_URL%
// @updateURL %DOWNLOAD_URL%
// @version 4.1.1
// @version 4.2.1
// @description Add various enhancements & QOL additions to the EdgeGamers MAUL page that are beneficial for CS Leadership members.
// @author blank_dvth, Left, Skle, MSWS
// @match https://maul.edgegamers.com/*
Expand Down Expand Up @@ -507,19 +507,34 @@ function handleProfile() {
...document.querySelectorAll("div.col-xs-6 > div > div:nth-child(3)"),
];
userNotes.forEach((userNote) => {
if (!userNote.textContent) return;
userNote.textContent = userNote.textContent.replaceAll(
/(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?p=(\d+)(?:#?post(\d+))?/g,
function (match, threadId, postId) {
return generateForumsURL(threadId, postId);
}
);
userNote.textContent = userNote.textContent.replaceAll(
/(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?(\d+)[\-a-zA-Z]*/g,
function (match, threadId) {
return generateForumsURL(threadId, null);
}
);
if (
!userNote.textContent ||
userNote.innerHTML.includes("<") ||
userNote.innerHTML.includes(">")
)
// Empty or possible HTML injection
return;
userNote.innerHTML = userNote.textContent
.replaceAll(
/(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?p=(\d+)(?:#?post(\d+))?/g,
function (match, threadId, postId) {
return generateForumsURL(threadId, postId);
}
)
.replaceAll(
/(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?(\d+)[\-a-zA-Z]*/g,
function (match, threadId) {
return generateForumsURL(threadId, null);
}
)
.replaceAll(
/https?:\/\/(www\.)?[-a-zA-Z0-9.]{1,256}\.[a-zA-Z0-9]{2,6}\b(\/[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g,
'<a href="$&" target="_blank" rel="external">$&</a>'
)
.replaceAll(
/([^\/\d]|^)(\d{17})([^\/\d]|$)/g,
'$1<a href="https://maul.edgegamers.com/index.php?page=bans&qType=gameId&q=$2" target="_blank">$2</a>$3'
);
});

// Attempt to get Source ID
Expand Down Expand Up @@ -654,7 +669,7 @@ function updateBanNoteURLs() {
handleProfile();
else if (
url.match(
/^https:\/\/maul\.edgegamers\.com\/index\.php\?[-=a-zA-Z0-9&]*page=bans.*$/
/^https:\/\/maul\.edgegamers\.com\/index\.php\?.*page=bans.*$/
)
)
// List Ban Page
Expand Down