-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable refresh delay for stylesheets when using inject and override remote CSS #707
Comments
The issue is that while 80% of the use-case for the delay feature is working with an external server that's remote and requires an upload, there ARE other reasons to use the delay. Over the years, I've seen complex setups with certain CMSes that need a moment when files change, users working on network drives with latency, folks hosting their websites on a Synology NAS, etc. So there ARE still cases where people would want the delay even when overriding remote CSS with a local copy. As a workaround, I'd recommend this:
When you save a page-like file, CodeKit will immediately reload the browsers once (but no changes will appear because the file hasn't finished uploading to your remote server yet). But the second refresh call from your Hook will get the job done. This essentially lets you apply the delay only when you need it. |
Thanks for the explanation and workaround suggestion, I think that’ll work nicely for now 👍 |
The AppleScript to refresh works with the delay when executing from anywhere other than the CK hook, otherwise it fires right after the first refresh.
|
Ha, of course it does. So the issue is that AppleScript must run on the main thread. If you do this:
You'll get the delay you're after, but CodeKit will hang for 5 seconds because the main thread is tied up running the AppleScript command (which includes the delay). Apparently, 2012 Bryan was smart enough to recognize that a Hook calling the refresh command with the delay parameter would hang the UI, so the delay parameter is ignored there. You may have better luck using the |
When working on a remote server with a refresh delay and overriding CSS, it'd be great to not have any delay for stylesheet injection.
The text was updated successfully, but these errors were encountered: