Browser Auto Refresh Script - Ruby Watcher
✓ Published0🌍 Public
FFasani
Last edited Jul 16, 2014
Created on Jul 16, 2014
This example shows a Ruby script that monitors a project folder for file changes and automatically refreshes matching browser tabs. It watches specified file types like CSS, HTML, and JavaScript using `Dir.glob` to collect files and compares their modification times with `File.stat().mtime`. When a change is detected, it executes an AppleScript via `osascript` to reload tabs in Google Chrome whose URLs contain a keyword. The script runs an infinite loop with a one-second sleep, and also includes commented-out AppleScript support for Safari and Firefox.
AI-generated description