forked from Inve1951/BetterDiscordStuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linkProfilePicture.plugin.js
23 lines (22 loc) · 1.05 KB
/
linkProfilePicture.plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* @name Link-Profile-Picture
* @description Lets you click users' avatars on their profile page to view a bigger version in your browser.
* @version 1.2.7
* @author square
* @authorLink https://betterdiscord.app/developer/square
* @website https://betterdiscord.app/plugin/Link-Profile-Picture
* @source https://github.com/Inve1951/BetterDiscordStuff/blob/master/plugins/linkProfilePicture.plugin.js
* @updateUrl https://raw.githubusercontent.com/Inve1951/BetterDiscordStuff/master/plugins/linkProfilePicture.plugin.js
*/
module.exports = class linkProfilePicture {
stop(){}
start() {
document.addEventListener("click", LinkProfilePicture, true);
this.stop = document.removeEventListener.bind(document, "click", LinkProfilePicture, true);
function LinkProfilePicture({ target }) {
if (target.classList.contains("avatar-3QF_VA") && target.parentElement?.parentElement?.classList.contains("header-S26rhB")) {
window.open(target.querySelector("img").src.replace(/(?:\?size=\d{2,4})?$/, "?size=4096"), "_blank");
}
}
}
};