Glance contextmenu search pref (#8963)

* Add zen.glance.enable-contextmenu-search preference and logic

* Add zen.glance.enable-contextmenu-search preference and logic
This commit is contained in:
Ernestas Tautkus
2025-06-10 20:02:27 +03:00
committed by GitHub
parent fcff502d1a
commit 17654139ba
2 changed files with 6 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
pref('zen.glance.enabled', true);
pref('zen.glance.enable-contextmenu-search', true);
pref('zen.glance.hold-duration', 300); // in ms
pref('zen.glance.open-essential-external-links', true);
pref('zen.glance.activation-method', 'alt'); // ctrl, alt, shift, none, hold

View File

@@ -748,8 +748,11 @@
}
onSearchSelectCommand(where) {
// Check if glance is enabled in user preferences
if (!Services.prefs.getBoolPref('zen.glance.enabled', false)) {
// Check if Glance is globally enabled and specifically enabled for contextmenu/search
if (
!Services.prefs.getBoolPref('zen.glance.enabled', false) ||
!Services.prefs.getBoolPref('zen.glance.enable-contextmenu-search', true)
) {
return;
}
if (where !== 'tab') {