2 ms·
I was curious how the hot-reloading works on the browser side. It looks like it starts its own Firefox window, keeps a reference to it, and somehow directly sen
by andrewflnr 4y ago
I was curious how the hot-reloading works on the browser side. It looks like it starts its own Firefox window, keeps a reference to it, and somehow directly sends an F5 keypress to it? I don't quite follow how that part works.
- adityaathalye 4y agoxdotool emulates user actions under the X Window System (e.g. typing, mouse around, click etc.). I'm using it to send keypresses to the browser, as you rightly observe. So if I want to just reload a page, the browser gets F5. To GOTO some page, it gets a stream of keystrokes for the URL characters and then Enter. It's really that simple-minded, and it works! This case statement covers my usage: https://github.com/adityaathalye/shite/blob/master/bin/hotreload.sh#L114 https://github.com/adityaathalye/shite/blob/master/bin/hotre...
- andrewflnr 4y agoThanks for the explanation!