Change avatar

Allows changing the avatar without having to use Gravatar.

Installation

Drag the following link into your browser’s bookmark bar: Change avatar

To inject the hack click the link in the bookmark bar while the Jitsi Meet tab is active. The effects only last until the next page reload.

Usage

After clicking the link in the bookmark bar you’ll be prompted to enter a URL for your avatar image. The default value is an image of the smiling face with sunglasses emoji: 😎

The avatar URL will be saved to the browser’s local storage, just like your display name. That means you only have to use the bookmarklet once per Jitsi instance.

How does it work?

The bookmarklet uses Jitsi’s built-in functionality to change the avatar URL. The URL is persisted automatically by Jitsi Meet alongside other values like the display name.

Source Code

// All of this code is contained in the bookmarklet
if (window.APP && APP.store) {
    const state = APP.store.getState();
    let avatarUrl = 'https://jitsi-hacks.cketti.eu/twemoji_smiling_face_with_sunglasses.png';
    if ('features/base/settings' in state && 'avatarURL' in state['features/base/settings']) {
        const oldAvatarUrl = state['features/base/settings'].avatarURL;
        if (oldAvatarUrl.length > 0) {
            avatarUrl = oldAvatarUrl;
        }
    }

    const newAvatarUrl = prompt("Avatar URL", avatarUrl);
    if (newAvatarUrl != null) {
        APP.conference.changeLocalAvatarUrl(newAvatarUrl);
    } else {
        console.log('[Jitsi Hacks] Not a Jitsi page');
    }
}