Skip to content

Lichess and Firefox Multi Account Containers

schlawg edited this page May 6, 2022 · 15 revisions

Most Lila features outside of puzzles and play with computer require interaction between multiple users. Anything that facilitates switching between them is useful for developers.

  • Use Firefox's Multi-Account Container extension to have multiple active users logged in to your dev instance, all in their own tabs with their own service workers.

  • Use New Tab Override extension to automatically open new Firefox containers in localhost:9663 and let the password manager or cookie isolation do the rest. Unfortunately, it is not possible to assign each container its own start page so if you use Firefox for other browsing, best to just leave new tabs blank and use a bookmark.

This menu creates a tab and logs in the user

Screen Shot 2022-05-06 at 1 21 07 AM

To make the tabs reflect the username, go to the st.headTitle block in the head tag of the apply method in app/ui/base/layout.scala and make it look like this:

          st.headTitle {
            if (ctx.blind) "lichess"
            else if (netConfig.isProd) fullTitle | s"$title • lichess.org"
            else ctx.me ?? {_.username}
          },

Don't check it in!

You could instead make spamdb users with command line option -bg 400 to give each one a random background image (which can make it easier to distinguish them). If you don't like the generated uids, they can be customized in lila-db-seed/spamdb/data/uids.txt. Background images are chosen from lila-db-seed/spamdb/data/image_links.txt.

For example:

python3 spamdb/spamdb.py --drop all -bg 400 -u 32

Creates a default database with 32 normal users selected from the first 32 lines of uids.txt (in addition to the special users - lichess, shusher, kid, troll, etc)

To see the other customization options, try python3 spamdb/spamdb.py --help

Clone this wiki locally