A universal userscript that adds a draggable floating auto-refresh widget to any website, with customizable intervals, smart positioning, and domain-based configuration. Originally designed for Jamf Pro, now works on any site you configure.
📢 Repository Renamed: This project was formerly known as
jamf-auto-refresh. GitHub automatically redirects old URLs, so existing installations will continue to work and receive updates.
- 🖱️ Draggable Floating Window - Move the widget anywhere on screen
- 📍 Position Memory - Remembers window position across page reloads
- ⏱️ Session Duration Tracking - Shows total uptime since first page load
- 🔄 Manual Refresh Button - Instantly refresh the page without waiting for the timer
- 🕒 Last Refresh Timestamp - Shows when the page was last refreshed (e.g., "30 sec ago")
- 📊 Session Counter - Tracks how many times the page has refreshed (persists across reloads)
- ⏱️ Customizable Intervals - Choose from 15 seconds to 30 minutes
- 🎯 Typing Detection - Delays refresh when actively typing in forms
- 💾 Persistent Statistics - All stats (counter, timestamp, session duration) survive page refreshes
- 🔔 Visual Countdown - Shows remaining time before next refresh
- 🎨 Modern Design - Gradient background with clean, intuitive interface
- 🎯 Always Accessible - Floats above page content, never gets hidden
-
Install a userscript manager for your browser:
- Chrome/Edge: Tampermonkey
- Firefox: Tampermonkey or Greasemonkey
- Safari: Userscripts
-
Install the script:
- Direct Install (Recommended): Click here to install
- Or download from GitHub Releases
- Or copy the contents of
jamf_auto_refresh.jsand create a new script in your userscript manager
-
Configure your Jamf Pro domains:
- Open the script in your userscript manager's editor
- Find the
USER CONFIGURATIONsection at the top of the script - Edit the
ENABLED_DOMAINSarray to include your Jamf Pro instance URLs - Example:
const ENABLED_DOMAINS = [ 'yourcompany.jamfcloud.com', 'jamf.yourcompany.com' ];
- Save the script
-
Navigate to your Jamf Pro instance
-
The floating widget will appear in the bottom-left corner (you can drag it anywhere)
The script automatically checks for updates daily. Your userscript manager will notify you when a new version is available.
To manually check for updates:
- Tampermonkey: Click the extension icon → Dashboard → Click the script name → Check for updates
- Greasemonkey: Click the extension icon → User Scripts → Click the script → Check for updates
The easiest way to configure domains is through the built-in visual interface:
- Open the floating widget on any page
- Click "⚙️ Domain Settings" button
- Use the visual interface to:
- View all configured domains
- Add new domain patterns
- Test patterns before adding
- Remove unwanted domains
- See which patterns match the current page
- ✅ Current Domain Indicator - Shows your current hostname
- ✅ Domain List - All configured domains with delete buttons
- ✅ Color Coding - Domains matching current page shown in green
- ✅ Test Button - Validate patterns before adding
- ✅ Real-time Feedback - Success/error messages
- ✅ Auto-save - Changes persist immediately
💻 Manual Configuration (Advanced) - Code editing for power users
You can also edit the configuration directly in the code:
To configure:
- Open your userscript manager (e.g., Tampermonkey)
- Click on the script to edit it
- Find the
USER CONFIGURATIONsection (near the top) - Edit the
DEFAULT_ENABLED_DOMAINSarray
Examples:
// Single domain
const DEFAULT_ENABLED_DOMAINS = [
'yourcompany.jamfcloud.com'
];
// Multiple domains
const DEFAULT_ENABLED_DOMAINS = [
'yourcompany.jamfcloud.com',
'jamf.yourcompany.com',
'jamf-prod.internal.company.com'
];
// Using wildcards (matches any subdomain)
const DEFAULT_ENABLED_DOMAINS = [
'*jamfcloud.com' // Matches any *.jamfcloud.com domain
];Note: The visual domain manager stores settings in localStorage. If you edit the code directly, those changes will be used as defaults for new configurations.
⚙️ Advanced Configuration - Path patterns, regex, per-domain intervals
Click the ▼ expand button on any domain to access advanced settings:
Set different refresh rates for different domains:
- Production: 5 minutes (less aggressive)
- Development: 15 seconds (rapid updates)
- Staging: 1 minute (balanced)
Enable auto-refresh only on specific pages:
Include Patterns (matches these paths):
/computers.html- Exact match/computers*- Starts with /computers*/devices/*- Contains /devices/ anywhere**- All paths (default)regex:^/computers/.*\.html$- Regex pattern
Exclude Patterns (blocks these paths - takes priority):
/settings/*- Don't refresh settings pages/admin/*- Don't refresh admin pagesregex:.*/edit/.*- Don't refresh any edit pages
Glob Patterns (simple wildcards):
*- Matches anything except/**- Matches anything including//computers*- Starts with /computers*/inventory/*.html- Contains /inventory/ with .html file
Regex Patterns (advanced matching):
- Prefix with
regex:to use regex regex:^/computers/.*\.html$- Computers pages ending in .htmlregex:^/(computers|devices)/- Computers OR devices pagesregex:^(?!.*/edit/).*$- Anything NOT containing /edit/
[
{
domain: 'prod.jamfcloud.com',
interval: 300000, // 5 minutes
paths: {
include: ['/dashboard*', '/computers.html'],
exclude: ['/settings/*']
}
},
{
domain: 'dev.jamfcloud.com',
interval: 15000, // 15 seconds
paths: {
include: ['*'],
exclude: []
}
}
][
{
domain: '*.jamfcloud.com',
interval: 60000, // 1 minute
paths: {
include: ['/computers.html', '/mobileDevices.html', '/inventory/*'],
exclude: []
}
}
][
{
domain: 'jamf.company.com',
interval: null, // Use global
paths: {
include: ['regex:^/(computers|devices)/.*\\.html$'],
exclude: ['regex:.*/edit/.*', 'regex:.*/settings/.*']
}
}
]- Drag Window: Click and hold the header to move the window anywhere on screen
- Manual Refresh: Click the 🔄 Refresh Now button to refresh immediately
- Toggle Auto-refresh: Click the Enable/Disable button to turn auto-refresh on or off
- Change Interval: Use the dropdown to select refresh interval (15s to 30min)
📊 Additional Features - Display information and smart features
The widget shows:
- Next refresh: Countdown to next automatic refresh
- Refresh count: Total number of refreshes (persists across page reloads)
- Last refresh: Time since last refresh (e.g., "30 sec ago")
- Session duration: Total uptime since first page load (e.g., "45m 20s")
The script automatically delays refresh when you're typing in forms to prevent data loss.
- 🏷️ Rebranding - Renamed to "Browser Auto Refresh" (universal functionality)
- 📦 Repository Renamed -
jamf-auto-refresh→browser-auto-refresh - 🔗 Updated URLs - All script headers point to new repository location
- ✅ Backward Compatible - Existing installations continue to work via GitHub redirects
- 📝 Enhanced Description - Emphasizes universal usability across any website
- 🔄 Auto-update - Users will automatically receive this update
- 🐛 Viewport Constraints Fix - Widget stays accessible during window resize
- 🎯 Smart Hybrid Positioning - Maintains relative position for center widgets, preserves edge positioning
- 🖱️ Real-time Drag Constraints - Cannot drag widget off-screen (20px minimum visible)
- ✅ Auto-correction - Invalid saved positions fixed on load
- ⚡ Smooth Performance - Debounced resize handler (250ms)
- 📐 Full Visibility - Entire widget (width + height) always visible
- 🐛 Script Duplication Fix - Prevents multiple instances during SPA navigation
- 🛡️ Session-Persistent Flags - Window-level protection flags prevent re-execution
- 🔄 History API Protection - Prevents multiple wrapping of pushState/replaceState
- 🖱️ Drag Listener Protection - Prevents accumulating document-level event listeners
- ⚡ Performance Improvements - Reduced memory usage and event listener overhead
📦 Previous Versions (click to expand)
- 🎯 Path-Based URL Matching - Enable only on specific pages
- 🌐 Glob Pattern Support - Use
*,**,/computers*,*/devices/* - 🔧 Regex Pattern Support - Use
regex:^/computers/.*\.html$for complex matching - ⏱️ Per-Domain Intervals - Set custom refresh rates for each domain
- 📍 Include/Exclude Paths - Fine-grained control over which pages to refresh
- ⚙️ Full Advanced Settings UI - Edit intervals and paths visually
- 🎨 Expandable Config Cards - Click to reveal advanced settings
- 💾 Auto-save Configuration - All changes persist immediately
- 🔄 Backward Compatible - Auto-migrates from v2.0.0
- 📊 Config Display - Shows interval and path count at a glance
- 🎨 Visual Domain Manager UI - Manage domains through intuitive modal interface
- ✨ No Code Editing Required - Add/remove domains with buttons and inputs
- 🧪 Pattern Testing - Test domain patterns before adding them
- 🎯 Real-time Feedback - Success/error messages for all operations
- 🔍 Domain Highlighting - Current domain shown in green if it matches a pattern
- ⌨️ Keyboard Support - Press Enter to add domains quickly
- 💾 Auto-save - Changes persist immediately to localStorage
- 🔙 Backward Compatible - Still supports DEFAULT_ENABLED_DOMAINS for manual editing
- ✨ User-Configurable Domains - Easy-to-edit configuration section at top of script
- 🌐 Universal @match - Script uses
@match *://*/*with runtime domain checking - 🔧 Domain Whitelist - Script only runs on domains you specify in ENABLED_DOMAINS array
- 📝 Wildcard Support - Use
*jamfcloud.comto match any subdomain - 🔒 Safe by Default - Won't interfere with other websites outside your whitelist
- 📚 Better Documentation - Comprehensive configuration examples in README
- 🎨 Reverted to Floating Window Design - Draggable floating window instead of sidebar integration
- ✨ Session Duration Tracking - Shows total uptime since first page load
- 💾 Persistent Statistics - Refresh counter, timestamp, and session duration survive page reloads
- 🖱️ Drag & Drop - Click and drag the header to reposition the window
- 📍 Position Memory - Window location saved to localStorage
- ✨ Simplified UI - All controls visible in one compact window (no dropdown)
- 🎨 Modern Design - Gradient background with improved visual hierarchy
- 🎯 Better Icons - Added emoji icons for visual feedback (🔄, ⏸, ▶)
- 🔧 Code Cleanup - Removed complex sidebar integration logic
- 🔧 Fix URL Matching - Added wildcard to match all pages, not just root
- ✨ Added support for
atlassian.jamfcloud.comdomain - 🐛 Fixed issue where script wouldn't load on Jamf instances
- 🎯 Perfect Native Integration - Widget perfectly mimicked Jamf's native sidebar items
- ✨ Used exact styling from native items (padding: 8px, height: 28px, gap: 12px)
- ✨ Matched native icon styling with proper SVG refresh icon
- 🎨 Major UI Overhaul - Moved from top navigation to sidebar
- ✨ Added full-width sidebar widget with icon, label, and countdown badge
- ✨ Added "Refresh Now" button for manual page refresh
- ✨ Added last refresh timestamp with live updates
- ✨ Added session refresh counter

