Skip to content

Add "Quick Open" Shortcut to Launch Top Link in New Window #175

@davidschenkUPG

Description

@davidschenkUPG

Enhancement Description

Add a keyboard shortcut to enhance usability by allowing lazy users to instantly open the top link in a new window without leaving the keyboard.
Especially useful, when there's only one row left after filtering by typing.

Proposed Behavior

  • Shortcut: Alt + Enter
  • Action: Opens the first link of table

Quick and dirty UserScript implementation:

// ==UserScript==
// @name        Quick Open Top Link
// @namespace   Violentmonkey Scripts
// @match       https://cmd.ms/*
// @description Opens the top search/filter result link in a new window using Alt + Enter
// @grant       none
// @version     0.1
// ==/UserScript==

(function () {
    'use strict';

    document.addEventListener('keydown', function (e) {
        // Check for Alt + Enter
        if (e.altKey && e.key === 'Enter') {
            // this selector will break, if the classes are changed in the future, but this is just a Proof of Concept.
            const links = document.querySelectorAll("td.commands-data-table.left.col-url > a");
            if (links.length > 0) {
                const topLink = links[0].href;
                window.open(topLink, '_blank');
            }
        }
    });
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions