Files
anki/run
Abdo 6770ad3ef4 fix: Update allowed origins for recent Chromium (#5080)
## Linked issue

Closes #5079

## Summary / motivation

Anki's webviews can be debugged by accessing http://127.0.0.1:8080/ in
Chromium-based browsers. In recent Chromium builds, the DevTools
inspector page is served from
https://chrome-devtools-frontend.appspot.com, which needs to be passed
to `--remote-allow-origins` to allow the connection.

## Steps to reproduce (before)

- Navigate http://127.0.0.1:8080/ after launching Anki (using one of the
run scripts)
- Open any listed page there and confirm you see an error: "Debugging
connection was closed".

## How to test (after)

Repeat the same steps and confirm you can access DevTools with no
errors.

## UI evidence

<img width="304" height="144" alt="image"
src="https://github.com/user-attachments/assets/159cfd9a-6112-4144-b88b-f2bee80b76a3"
/>
2026-06-30 19:29:03 +03:00

21 lines
794 B
Bash
Executable File

#!/bin/bash
set -e
export PYTHONWARNINGS=default
export PYTHONPYCACHEPREFIX=out/pycache
# define these as blank before calling the script if you want to disable them
export ANKIDEV=${ANKIDEV-1}
export QTWEBENGINE_REMOTE_DEBUGGING=${QTWEBENGINE_REMOTE_DEBUGGING-8080}
export QTWEBENGINE_CHROMIUM_FLAGS=${QTWEBENGINE_CHROMIUM_FLAGS---remote-allow-origins=https://chrome-devtools-frontend.appspot.com,http://localhost:$QTWEBENGINE_REMOTE_DEBUGGING}
export PYENV=${PYENV-out/pyenv}
# The pages can be accessed by, e.g. surfing to
# http://localhost:40000/_anki/pages/deckconfig.html
# Useful in conjunction with tools/web-watch for auto-rebuilding.
export ANKI_API_PORT=${ANKI_API_PORT-40000}
export ANKI_API_HOST=${ANKI_API_HOST-127.0.0.1}
./ninja pylib qt
${PYENV}/bin/python tools/run.py $*