My idea is simple. Create a local server and open a URL from there.
python -m http.server 8000 xdg-open http://0.0.0.0:8000/
But as you guess