launch-editor
launch-editor copied to clipboard
Empty browser window/tab is left after opening `__open-in-editor` link from JS console/terminal.
A side effect of opening an __open-in-editor link from the terminal/console is an empty browser window is left opened.
To reproduce:
- Start vite dev server on port 5173
- Paste
http://localhost:5173/__open-in-editor?file=/into browser JS console. - Click resulting link.
May also echo link to terminal and CTRL+click the link.
Work-around:
- Install my custom vite plugin that writes
'<script>window.close()</script>'in response. - (I also added a short message in case JS is not enabled.)
- It would be nice if the internal
__open-in-editormiddleware did this by default.
Context:
I wrote a utility function that outputs the __open-in-editor link for the file it was called from.