Back to Chrome Extensions Samples

chrome.tabs - Keyboard Pin

api-samples/tabs/pin/README.md

latest912 B
Original Source

chrome.tabs - Keyboard Pin

A sample that demonstrates how to use the chrome.tabs API to toggle the pinned state of the current tab.

Overview

In this sample, a new keyboard shortcut (Alt + Shift + P) is enabled to pin the current tab.

Implementation Notes

Chrome fires chrome.commands.onCommand when the user presses a registered keyboard shortcut.

Calls chrome.tabs.update() to pin or unpin the current tab.

Running this extension

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.
  3. Press Alt + Shift + P to pin the current tab.