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.

  1. Find an image you want to use as an avatar (or upload it to a public image hosting website)
  2. Get the URL to the image (right click -> "Copy Image Link")
  3. 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
  4. Go to the Console tab in the Developer Tools
  5. 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"
});
  1. Press Enter to execute the code. You should see some kind of 400 error, but it seems the result sticks
  2. Refresh the current Lemmy page or go to a different one to see if you have a new avatar