A Chrome extension for Athos developers to inject, test, and debug Snap bundles on client sites. This tool allows you to override existing scripts, inject local development bundles, and control script loading behavior.
- π Script Injection: Inject custom Snap bundles onto any site
- π Live Bundle Switching: Toggle between local development and CDN-hosted bundles
- π‘οΈ Network Intercepts: Block existing scripts to prevent conflicts
- π Integration Details: View real-time information about loaded Snap controllers
- βοΈ Context Variables: Inject custom context variables with bundle scripts
- π― Per-Site Configuration: Settings are saved per hostname for easy context switching
- π¨ Modern UI: Clean, dashboard-style interface with live loading states
git clone git@github.com:searchspring/snapfu-extension.git
cd snapfu-extension
npm install
npm run build- Navigate to
chrome://extensions/in your Chrome browser - Toggle ON 'Developer Mode' (top-right corner)
- Click 'Load unpacked'
- Navigate to the cloned repository and select the
releasedirectory
The Athos Commerce Snapfu Extension should now be available in Chrome.
Click the Athos extension icon in your Chrome toolbar to open the popup interface.
Click the toggle switch in the header to enable/disable the extension for the current site. When enabled, the extension will inject your configured bundle and block intercepted URLs.
The Bundle URL field controls which Snap bundle script to inject onto the page.
- local button: Sets URL to
https://localhost:3333/bundle.js(default local development URL) - cdn button: Sets URL to
https://snapui.athoscommerce.io/siteid/branch/bundle.js(Athos Commerce CDN template)
For CDN URLs, replace siteid and branch with your actual site ID and branch name. This requires that the @searchspring/snap-action GitHub Action has successfully deployed to the specified branch.
You can manually enter any URL in the Bundle URL field. The reset icon (βΊ) will restore the default value.
Add custom context variables to be injected with the bundle script. These variables will be available to your Snap implementation.
- Enter valid JavaScript object notation in the text area
- Enable Merge context to combine your context with any existing context on the page
- The reset icon (βΊ) will clear your custom context
When a Snap bundle is loaded, the extension displays:
- Site ID: The Athos site identifier
- Version: The loaded Snap bundle version
- Controllers: Count and details of active Snap controllers
Click the header to expand and view detailed controller information including:
- Controller type (search, autocomplete, recommendation, finder)
- Load status
- Result count
- Plugin count
- Configuration globals and settings
The extension can block network requests to prevent conflicts with existing scripts.
- Click the Settings gear icon in the header
- Find the Intercepts section
- Add one URL pattern per line
By default, the extension blocks these common Snap and legacy script URLs:
*://snapui.athoscommerce.io/*/bundle.js*
*://snapui.searchspring.io/*/bundle.js*
URL patterns support wildcards (*) for flexible matching.
Advanced users can customize where the script is injected in the DOM using the Injection Target field in Settings. This supports iframe targeting with syntax like iframe >>> head.
All configuration (Bundle URL, Context, Intercepts) is saved per hostname. This allows you to maintain different settings for different development environments and client sites.
- Reset Site: Clear all settings for the current hostname and return to defaults
- Reset All: Clear all extension data across all hostnames (requires confirmation)
npm installCompile the extension for production:
npm run buildOutput will be in the release/ directory.
Run with hot-reload for Vue components:
npm run devNote: Changes to non-Vue files (like background.ts, manifest, or assets) require manually refreshing the extension in chrome://extensions/. In some cases, you may need to remove and reload the extension completely.
src/
βββ components/
β βββ popup.vue # Main popup container
β βββ popup/
β βββ popup-config.vue # Configuration tab
β βββ popup-settings.vue # Settings tab
β βββ popup-header.vue # Header with logo and controls
β βββ popup-controller.vue # Controller detail display
βββ entry/
β βββ background.ts # Service worker
β βββ inject.ts # Content script injection
β βββ loader.ts # Script loader
β βββ popup.ts # Popup entry point
β βββ scraper.ts # Integration detection
βββ types/ # TypeScript definitions
βββ utilities/ # Helper functions
- Framework: Vue 3 with Composition API
- Language: TypeScript
- Styling: SCSS
- Icons: Font Awesome
- Build Tool: Vue CLI / Webpack
- Chrome APIs: Declarative Net Request, Storage, Tabs, Scripting
When contributing to this extension:
- Follow the existing code style and component patterns
- Test thoroughly in Chrome before submitting PRs
- Update this README if adding new features
- Ensure the build completes without errors
Internal Athos tool for development use.
