Skip to content

Commit c684711

Browse files
Add an item to group the active tab in a new group. (#592)
* Add an item to group the active tab in a new group. * Text update --------- Co-authored-by: rebloor <[email protected]>
1 parent 386f262 commit c684711

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tabs-tabs-tabs/tabs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
<a href="#" id="tabs-create">Create a tab</a><br>
2727
<a href="#" id="tabs-remove">Remove active tab</a><br>
28+
<a href="#" id="tabs-group">Add active tab to a new group</a><br>
2829

2930
<div class="panel-section-separator"></div>
3031

tabs-tabs-tabs/tabs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ document.addEventListener("click", (e) => {
9898
});
9999
}
100100

101+
else if (e.target.id === "tabs-group") {
102+
callOnActiveTab((tab) => {
103+
browser.tabs.group({ tabIds: [tab.id] });
104+
});
105+
}
106+
101107
else if (e.target.id === "tabs-create") {
102108
browser.tabs.create({url: "https://developer.mozilla.org/en-US/Add-ons/WebExtensions"});
103109
}

0 commit comments

Comments
 (0)