forked from Inve1951/BetterDiscordStuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linkProfilePicture.plugin.js
22 lines (21 loc) · 1.02 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
/**
* @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.1
* @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 {
start() {
document.addEventListener("click", LinkProfilePicture, true);
this.stop = document.removeEventListener.bind(document, "click", LinkProfilePicture, true);
function LinkProfilePicture({ target }) {
if (target.classList.contains("avatar-AvHqJA") && target.parentElement.classList.contains("header-4zuFdR")) {
window.open(target.querySelector("img").src.replace(/(?:\?size=\d{3,4})?$/, "?size=4096"), "_blank");
}
}
}
};