forked from Shinonome/dots-hyprland
booru: add domain name to go to source button
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user