-
Notifications
You must be signed in to change notification settings - Fork 27
/
pinTabHotkey.uc.js
28 lines (27 loc) · 1.34 KB
/
pinTabHotkey.uc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ==UserScript==
// @name Pin Tab Hotkey
// @version 1.1.1
// @author aminomancer
// @homepageURL https://github.com/aminomancer/uc.css.js
// @description Press Ctrl+Alt+P (or ⌘ ⌥ P on macOS) to pin/unpin selected tab(s). Configure by changing modifiers and key values below.
// @downloadURL https://cdn.jsdelivr.net/gh/aminomancer/uc.css.js@master/JS/pinTabHotkey.uc.js
// @updateURL https://cdn.jsdelivr.net/gh/aminomancer/uc.css.js@master/JS/pinTabHotkey.uc.js
// @license This Source Code Form is subject to the terms of the Creative Commons Attribution-NonCommercial-ShareAlike International License, v. 4.0. If a copy of the CC BY-NC-SA 4.0 was not distributed with this file, You can obtain one at http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
// ==/UserScript==
_ucUtils.registerHotkey(
{
// one or more of: alt, shift, ctrl, meta, accel. separated by space, enclosed by quotes.
modifiers: "accel alt",
// one of: A-Z, - (hyphen), or F1-F12. enclosed by quotes.
key: "P",
// key ID. don't change this.
id: "key_togglePinTab",
},
win => {
if (win === window) {
gBrowser.selectedTab.pinned
? gBrowser.unpinMultiSelectedTabs()
: gBrowser.pinMultiSelectedTabs();
}
}
);