booru: add domain name to go to source button

This commit is contained in:
end-4
2025-05-04 20:44:37 +02:00
parent 1fe568150f
commit 84ae535756
2 changed files with 9 additions and 4 deletions
@@ -3,3 +3,8 @@ function format(str, ...args) {
typeof args[index] !== 'undefined' ? args[index] : match
);
}
function getDomain(url) {
const match = url.match(/^(?:https?:\/\/)?(?:www\.)?([^\/]+)/);
return match ? match[1] : null;
}