PR Opener

A Chrome extension that opens a pull request from the URL bar. Type pull, press Tab, type a PR number and press Enter. Try it below: the real code of the extension runs in this page.

Try the extension

  1. Type pull
  2. Press Tab
  3. Type a number
  4. Press Enter
Keys for a touch screen
Enter opens the link in
The demo

Live log 0 lines

Each event that Chrome fires, and each call of the real scripts.

    Configure the repos

    This is the real options page of the extension. Add, change or move a repo, and select Save. The suggestions in the URL bar then use the new list. The first repo is the default.

    Options page options.html

    chrome.storage.sync

    
                

    Save writes this value. Open again shows it, and removes each change that you did not save.

    How it works

    1. 1

      The keyword

      manifest.json sets the omnibox keyword pull. After Tab, Chrome sends the text of the bar to the extension.

    2. 2

      Each key

      onInputChanged reads the repos. The first repo goes in the default row. Each other repo gets a row with the content number|index.

    3. 3

      Enter

      onInputEntered reads the number and the repo index. It adds the number to the repo URL, and it calls chrome.tabs.

    4. 4

      The options

      The options page writes the list to chrome.storage.sync. An empty list gives the default repo of src/types.ts.

    Real code in this page

    The stand-in

    • This page draws the URL bar and the tabs. It sets its own chrome object before it loads the scripts.
    • That object fires the omnibox events, keeps the storage in memory and records the tab calls.
    • It has no storage quota and no sync between devices. Chrome also shows fewer rows when the list is long.

    Install

    The extension is not in the Chrome Web Store. Build it, then load the folder.

    git clone https://github.com/mark1russell7/pr-opener.git
    cd pr-opener
    pnpm install
    pnpm build
    1. Open chrome://extensions in Chrome.
    2. Turn on Developer mode.
    3. Select Load unpacked, then select the pr-opener folder.