A Chrome extension that adds a configurable horizontal navigation menu to Salesforce Setup pages for quick access to commonly used setup pages.
- Horizontal Navigation Menu: Clean, dropdown-based navigation that appears at the top of Salesforce Setup pages
- Fully Configurable: Customize menu items via in-page modal or options page
- Quick Access: Navigate to frequently used Setup pages with just two clicks
- Star Button: Quickly add the current Setup page to your menu
- Persistent Configuration: Your menu configuration is saved and synced across Chrome instances
- Modular Architecture: Clean, maintainable codebase with separation of concerns
- Download or clone this repository to your local machine
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" using the toggle in the top right
- Click "Load unpacked"
- Select the
salesforce-navfolder - The extension is now installed!
# Install dependencies (optional, for linting/formatting)
npm install
# Run validation tests
npm test
# Run unit tests
npm run test:unit
# Check build readiness
npm run build:check
# Lint code
npm run lint
# Format code
npm run format- Navigate to any Salesforce Setup page (e.g.,
https://yourinstance.lightning.force.com/lightning/setup/SetupOneHome/home) - You'll see a new horizontal menu bar appear with your configured menu items
- Click any menu header to see dropdown options
- Click any menu item to navigate to that Setup page
- Navigate to any Salesforce Setup page
- Click the star button (β) at the left of the menu bar
- Choose which menu group to add it to
- Optionally edit the label
- Click Save
- Click the gear button (βοΈ) at the right of the menu bar
- The settings modal will open with full menu management:
- Add/remove menu groups
- Add/remove menu items
- Reorder groups and items using β/β buttons
- Edit labels and paths inline
- Click "Save" to apply your changes
- Click "Reset" to restore defaults
- Click "Export" to download your configuration as JSON
The configuration is an array of menu groups. Each group has:
title: The text displayed in the top menu baritems: An array of menu items, each with:label: The text displayed in the dropdownpath: The Salesforce Setup path (relative to/lightning/setup/)
Example:
[
{
"title": "Users",
"items": [
{
"label": "Users",
"path": "ManageUsers/home"
},
{
"label": "Profiles",
"path": "EnhancedProfiles/home"
}
]
}
]The extension comes with the following default menu structure:
- Users, Profiles, Permission Sets, Queues, Territory Models
- Apex Classes, Apex Testing, LWC, Custom Metadata Types, App Manager, Flows
- Object Manager, Account, Plan, Case
- Apex Jobs, Bulk Data Load, Scheduled Jobs
- Transaction Security Policies, Event Manager, Event Log File Browser, Sharing Settings, Connected Apps
- Company Info, Storage Usage, Sandboxes, Audit Trail, My Domain
The codebase follows a modular architecture:
salesforce-nav/
βββ manifest.json # Extension manifest (MV3)
βββ config.js # Default menu configuration
βββ content.js # Main orchestrator (minimal)
βββ styles.css # All styles
βββ src/
β βββ constants.js # All constants and magic values
β βββ utils.js # Utility functions
β βββ storage.js # Chrome storage management
β βββ menu.js # Menu creation and rendering
β βββ settings.js # Settings modal logic
β βββ star.js # Star button for adding pages
βββ tests/
βββ validate.js # Validation checks
βββ unit-tests.js # Unit tests
βββ build-check.js # Build readiness check
- Separation of Concerns: Each module has a single responsibility
- No Inline Styles: All styling in CSS files
- Constants Over Magic Values: All hardcoded values extracted to constants
- URL Validation: Security checks on all user-provided URLs
- Error Handling: Proper try-catch and user feedback
- Small Orchestrator: Main content.js is just coordination logic
- URL Validation: All paths are validated against allowed patterns
- Input Sanitization: User input is sanitized before display
- Storage Validation: Configuration is validated before saving
- Safe Navigation: Only allows navigation to Salesforce Setup paths
# Run all tests
npm test
# Run specific test suites
npm run test:unit # Unit tests for pure functions
npm run validate # Validate manifest and config
npm run build:check # Check build readiness
# Linting and formatting
npm run lint # Check for linting errors
npm run lint:fix # Auto-fix linting errors
npm run format # Format all files
npm run format:check # Check formattingMenu not appearing:
- Make sure you're on a Salesforce Lightning Setup page
- Check that the URL matches:
https://*.lightning.force.com/*or similar - Try refreshing the page
- Check that the extension is enabled in
chrome://extensions/
Configuration not saving:
- Ensure your JSON is valid (use the settings modal for easier editing)
- Check that each menu group has both
titleanditems - Check that each item has both
labelandpath - Open browser console to check for errors
Menu appears in wrong location:
- The extension tries to intelligently place the menu
- Different Salesforce orgs may have slightly different layouts
- If positioning is off, the menu will still be functional at the top of the page
- ESLint: Enforces code quality rules
- Prettier: Ensures consistent formatting
- Validation: Automated checks for manifest and config
- Tests: Unit tests for utility functions
- Make your changes in the appropriate module
- Run
npm run lint:fixto fix linting issues - Run
npm run formatto format code - Run
npm testto validate changes - Test manually in Chrome with "Load unpacked"
The manifest.json specifies the load order for JS files:
src/constants.js- Must load first (defines constants)src/utils.js- Must load second (uses constants)src/storage.js- Uses utilsconfig.js- Defines DEFAULT_MENU_CONFIGsrc/menu.js- Menu logicsrc/settings.js- Settings logicsrc/star.js- Star button logiccontent.js- Orchestrator (loads last)
- Total Size: ~70 KB
- Main Content Script: ~150 lines (was 819!)
- Modules: 6 separate modules
- Constants: 30+ extracted
- Test Coverage: Unit tests for all utilities
- Validation: 3 test suites
- β Complete modular refactor
- β Fixed critical manifest domain bug
- β Added URL validation and security
- β Extracted all constants
- β Removed code duplication
- β Added comprehensive tests
- β Moved all styles to CSS
- β Added linting and formatting
- β Improved error handling
- Initial release with configurable menu system
- Fork the repository
- Create a feature branch
- Make your changes following the code quality standards
- Run all tests (
npm test) - Submit a pull request
MIT
For issues or feature requests, please open an issue in the repository.