forked from philhk/Vencord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters