-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) Add reset to pinned URL button to pinned tabs
This commit introduces a "Reset" button to pinned tabs, allowing users to quickly revert a tab to its stored base URL. The button is visible on hover for non-essential pinned tabs and hidden for essentials. Clicking the button triggers a reset action managed by `gZenPinnedTabManager`. The visual style of the button is defined using the "reload" icon and follows the styling of other tab buttons.
- Loading branch information
1 parent
3277e06
commit 38898ab
Showing
3 changed files
with
109 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js | ||
index 60061540d79843281f3ee2ce905824b224da6f46..c01f8a7f18921588ecdc635c281cf01041ef627b 100644 | ||
--- a/browser/components/tabbrowser/content/tab.js | ||
+++ b/browser/components/tabbrowser/content/tab.js | ||
@@ -39,6 +39,7 @@ | ||
</hbox> | ||
</vbox> | ||
<image class="tab-close-button close-icon" role="button" data-l10n-id="tabbrowser-close-tabs-button" data-l10n-args='{"tabCount": 1}' keyNav="false"/> | ||
+ <image class="tab-reset-button reset-icon" role="button" data-l10n-id="tabbrowser-reset-tabs-button" data-l10n-args='{"tabCount": 1}' keyNav="false"/> | ||
</hbox> | ||
</stack> | ||
`; | ||
@@ -447,6 +448,7 @@ | ||
this.style.MozUserFocus = "ignore"; | ||
} else if ( | ||
event.target.classList.contains("tab-close-button") || | ||
+ event.target.classList.contains("tab-reset-button") || | ||
event.target.classList.contains("tab-icon-overlay") | ||
) { | ||
eventMaySelectTab = false; | ||
@@ -549,6 +551,11 @@ | ||
// (see tabbrowser-tabs 'click' handler). | ||
gBrowser.tabContainer._blockDblClick = true; | ||
} | ||
+ | ||
+ if (event.target.classList.contains("tab-reset-button")) { | ||
+ gZenPinnedTabManager._resetTabToStoredState(this); | ||
+ gBrowser.tabContainer._blockDblClick = true; | ||
+ } | ||
} | ||
|
||
on_dblclick(event) { |
This file contains 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