Closed sgoodwin closed 12 years ago
Yep. The "right way" to do this is through a JavaScript WebSocket connection to the app. Which means we need:
<script>
code into each page.For the record, this actually won't be as hard as I was thinking, because the CocoaHTTPServer project that we already include has a WebSocket server class already.
Why websockets and not just auto-refresh?
WebSockets are how you implement efficient "auto-refresh". I don't want the page to just be constantly refreshing itself in the browser, that's inefficient and annoying. You should have the page open in the browser, the page opens a socket connection to the app, the app sends a "page needs to be refreshed" command through the socket whenever a file is changed.
I guess that makes more sense. :P
Completed and merged.
We currently need the Apple Event sending exception to make Safari auto-refresh work. This could definitely be improved by having a browser-agnostic auto-refresh system, but I haven't figured that out yet.