Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavotrott committed Nov 9, 2023
0 parents commit 146ebc6
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<h1 align="center">Welcome to brave-lock-pinned-tabs 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<a href="http://www.wtfpl.net/about/" target="_blank">
<img alt="License: WTFPL" src="https://img.shields.io/badge/License-WTFPL-yellow.svg" />
</a>
</p>

> Brave extension to prevent pinned tabs from being closed accidentally
## Installation

Clone this repo and [load the extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/#unpacked).

## Usage

1. In your browser open the address `brave://extensions/shortcuts`

2. Look for the extension "Lock Pinned Tabs"

3. In the option `Activate the extension` set the key `Ctrl + w`

4. Now it will replace the default `Ctrl + w` and this extension will prevent pinned tabs from being closed using Ctrl + W.

-------------


This extension was inspired on https://github.com/gabrielmaldi/chrome-lock-tab
Binary file added images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Lock Pinned Tabs",
"description": "Prevents pinned a tab from being closed accidentally",
"version": "1.0.0",

"author": "gustavotrott",
"homepage_url": "https://github.com/gustavotrott/chrome-lock-tab",
"manifest_version": 3,
"permissions": [
"activeTab"
],
"icons": {
"128": "images/icon_128.png"
},
"background": {
"service_worker": "src/background.js"
},
"action": {}
}
5 changes: 5 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
chrome.action.onClicked.addListener((tab) => {
if (!tab.pinned) {
chrome.tabs.remove(tab.id);
}
});

0 comments on commit 146ebc6

Please sign in to comment.