Disclaimer: Pasting code is usually dangerous, so you might want to give other people in this community the opportunity to audit my code before trying it yourself.
- Find an image you want to use as an avatar (or upload it to a public image hosting website)
- Get the URL to the image (right click -> "Copy Image Link")
- In a web browser, go to your Lemmy instance (I tested this on lemm.ee) and hit the F12 key to bring up Developer Tools
- Go to the Console tab in the Developer Tools
- Paste the following code, changing the "avatar" to the name of the picture you just uploaded:
body = {
avatar: "https://i.imgur.com/h7lq4kp.jpeg",
auth: document.cookie.match(/jwt=(.*?)(?:\;|$)/)[1]
}
fetch(location.origin + "/api/v3/user/save_user_settings", {
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
method: "PUT",
mode: "cors"
});
- Press Enter to execute the code. You should see some kind of 400 error, but it seems the result sticks
- Refresh the current Lemmy page or go to a different one to see if you have a new avatar
deleted by creator