Skip to content

Commit

Permalink
Add keyboard support with "Ctrl+Alt+T" as the default (fixes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
irvinm committed Dec 14, 2024
1 parent fe2c227 commit 2160ea5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ browser.browserAction.onClicked.addListener((tab) => {
setPrefaceAndIcon();
});

// Add a listener for the command
browser.commands.onCommand.addListener((command) => {
if (command === "toggle-tab-bar") {
hideTabBar = !hideTabBar;
localStorage.setItem('hideTabBar', JSON.stringify(hideTabBar));
setPrefaceAndIcon();
}
});

// Listen for when a new window is created
browser.windows.onCreated.addListener((window) => {
setPrefaceAndIcon();
Expand Down
8 changes: 8 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@
},
"icons": {
"128": "icon-hidden.png"
},
"commands": {
"toggle-tab-bar": {
"suggested_key": {
"default": "Ctrl+Alt+T"
},
"description": "Toggle the native tab bar"
}
}
}

0 comments on commit 2160ea5

Please sign in to comment.