A Chrome extension that forces all links on webpages to open in the same tab instead of new windows or tabs, with additional link selection features.
-
Same Tab Navigation: Removes
target="_blank"andtarget="_new"attributes from all links -
Dynamic Content Support: Handles dynamically added content through MutationObserver
-
Link Selection: Select and copy multiple links by dragging your mouse
-
Customizable: Configure your own link selection key
-
Works on all websites: Lightweight and efficient
chrome-hyperlink-powerups/
├── manifest.json # Extension configuration
├── background.js # Background service worker
├── content.js # Content script
├── options.html # Options page
├── options.js # Options logic
├── icons/ # Extension icons
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
├── package.json # Project configuration
└── README.md # This file
-
Clone this repository:
git clone https://github.com/yourusername/chrome-hyperlink-powerups.git cd chrome-hyperlink-powerups -
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select this project folder
- The extension will be installed and active
- Open Chrome and navigate to
That's it! No build process needed - the extension works directly from the source files.
Once installed, the extension will automatically:
- Work on all websites you visit
- Force all links to open in the same tab
- Show a console message when active
- Open the extension options page
- Set your custom shortcut key (default: "Z")
- Hold down your custom key
- Click and drag to create a selection box
- Release to copy all links in the selected area to clipboard
- Custom Key + Drag: Select and copy multiple links
manifest.json: Extension configuration, permissions, and file referencesbackground.js: Background service worker that manages extension statecontent.js: Content script that modifies link behavior and provides link selectionoptions.html: Options page for user configurationoptions.js: Options page functionalityicons/: Extension icons in different sizes
- Edit files directly in the project folder
- Reload the extension in Chrome when you make changes:
- Go to
chrome://extensions/ - Click the refresh icon on your extension
- Go to
- Test your changes on any website
The extension uses multiple components:
- Background Script: Manages extension state and handles keyboard shortcuts
- Content Script: Modifies link behavior and provides link selection functionality
- Options Page: Allows users to configure settings
- Manifest: Defines extension permissions and structure
- Modifies existing links: Removes
targetattributes from all links on page load - Handles dynamic content: Uses MutationObserver to catch newly added links
- Intercepts clicks: Prevents default behavior for links that would open new windows
- Forces same-tab navigation: Redirects all link clicks to open in the current tab
To test the extension:
- Install the extension
- Visit any website with links that open in new tabs
- Click on those links - they should now open in the same tab
- Test the link selection feature by holding your custom key and dragging
- Check the browser console for any error messages
- If links still open in new tabs, try refreshing the page
- Check the browser console for any error messages
- Ensure the extension is enabled in
chrome://extensions/ - Verify that all files are in the correct locations
This extension requires:
activeTab: To run content scripts on web pagesstorage: To save user settings
No personal data is collected or transmitted by this extension.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.