Optional Selection Requirement#197
Merged
Pitmairen merged 51 commits intoPitmairen:masterfrom Apr 6, 2026
Merged
Conversation
Remove necessity of having query to allow "searches" without input
Add %PAGE_ORIGIN_NO_ENCODING parameter
Pull from original add-on
# Conflicts: # README.md
This file provides architectural guidance and development context for Claude Code when working with the Selection Search extension codebase.
Added note that this is a fork of the original Selection Search extension by Pitmairen, with links to both repositories.
Add a new user-configurable option 'allow_engines_without_selection' that allows the popup to be activated without text selection. This enables using the extension as a link collection tool for quick navigation. When enabled (default: OFF): - Inline popup activators show popup even without text selection - Toolbar popup works without entering query text - Context menu shows all engines in both 'selection' and 'page' contexts - All search engines appear regardless of having %s placeholder - Engines with %s search for empty string; engines without %s navigate directly Implementation: - Add option to storage defaults (background/storage.js) - Update all popup activators to check the option (popup/activators.js) - Make toolbar hasQuery() conditional (browseraction/popup.js) - Add 'page' context to context menu items when enabled (background/contextmenu.js) - Add UI checkbox in options page (options/options.html) - Update documentation about %s being optional The option is automatically included in export/import functionality. Default is OFF to maintain backward compatibility with existing users.
The option was added to storage and UI but wasn't connected to the save/load functions in options.js, causing it to always stay false. - Add option to load function (line 383) - Add option to save function (line 650) This fixes the issue where enabling the checkbox had no effect.
Version 0.9.9 adds the optional 'allow_engines_without_selection' feature: - Popup can be activated without text selection when enabled - Useful for using extension as link collection tool - Disabled by default for backward compatibility - Context menu appears on page context when enabled
- Remove CLAUDE.md (fork-specific documentation) - Remove 'Installation for Chrome' section from README (fork-specific) - Remove 'Configuration' section from README (SAP-specific)
These files are for local testing only and not part of the feature.
Pitmairen
reviewed
Mar 11, 2026
Owner
Pitmairen
left a comment
There was a problem hiding this comment.
Found a couple of issues when testing in Chrome.
- Move "Allow engines without selection" option from Advanced Settings to Other Options section - This is a global option affecting all menu types, so it belongs in Other Options - Update reference text to reflect new location - Fix IndexSizeError when clicking without text selection - Add check for selection.rangeCount before calling getRangeAt(0) in getSelectionRect() - Early return false in isPointOnSelection() when rect is undefined - Prevents crash when clicking page/links with allow_engines_without_selection enabled
Contributor
Author
|
Fixed all the comments |
Pitmairen
reviewed
Mar 21, 2026
…ndMouseActivator - Fix ClickActivator to show popup when allow_engines_without_selection is enabled - Fix KeyAndMouseActivator popupShouldOpen to check _mouseButton instead of _options.button
Owner
|
It seems to work fine now. I'm merging it, but I will probably make a few tweaks before making a new release. I think I will disable it for the mouse click activator, because opening the popup on every click is probably not what most people wants. But for the other activators, context menu and toolbar popup it works well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Optional Selection Requirement Feature
Summary
This PR adds a new user-configurable option
allow_engines_without_selectionthat enables using the extension as a link collection tool for quick navigation without requiring text selectionfirst.
Motivation
Users who want to use the extension for quick access to frequently used URLs (e.g., multiple test environment instances like
https://test1.example.com/dashboard,https://test2.example.com/dashboard) currently must select text first to activate the popup. This PR makes text selection optional.Changes
New Option
allow_engines_without_selectionfalse(maintains current behavior for existing users)Behavior When Enabled
Files Modified (6 files, ~70 lines changed)
background/storage.js- Added option to defaultsbackground/contextmenu.js- Added 'page' context support when option enabledbrowseraction/popup.js- MadehasQuery()conditional on optionpopup/activators.js- Updated all activators to check optionoptions/options.html- Added UI checkbox and updated documentationoptions/options.js- Connected save/load functionsImplementation Details
The implementation is minimal and non-invasive:
Testing
Tested scenarios:
Backward Compatibility
Use Cases
Version
Bumped to 0.9.9 with changelog entry.
Notes