Skip to content

Commit

Permalink
Add linkProfilePicture plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Loukious committed Mar 22, 2024
1 parent e1f8b3c commit f7d804c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/plugins/linkProfilePicture/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";


function LinkProfilePicture({ target }) {
if (target.classList.contains("avatar__445f3") && target.parentElement?.parentElement?.classList.contains("header__7da4f")) {
window.open(target.querySelector("img").src.replace(/\?.*$/, "?quality=lossless&size=4096"), "_blank");
}
}

export default definePlugin({
name: "LinkProfilePicture",
description: "Lets you click users' avatars on their profile page to view a bigger version in your browser.",
authors: [Devs.Loukios],
start() {
document.addEventListener("click", LinkProfilePicture, true);
},
stop() {
document.removeEventListener.bind(document, "click", LinkProfilePicture, true);
}
});
4 changes: 4 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
newwares: {
name: "newwares",
id: 421405303951851520n
},
Loukios: {
name: "Loukios",
id: 211461918127292416n
}
} satisfies Record<string, Dev>);

Expand Down

0 comments on commit f7d804c

Please sign in to comment.