Re:Show HN: Shite: The little hot-reloadin' static site make...
by andrewflnr on Monday January 23, 2023 @06:15PM
(#34496473)
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.
[ Parent
| on HN ]
Re:Show HN: Shite: The little hot-reloadin' static site make...
by adityaathalye on Tuesday January 24, 2023 @05:16AM
(#34501823)
xdotool 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/hotre...
Re:Show HN: Shite: The little hot-reloadin' static site make...
by andrewflnr on Tuesday January 24, 2023 @11:41AM
(#34506038)
Thanks for the explanation!