Ctrl+K to focus on search (currently only works on MDN)

This is a userscript.

// ==UserScript==
// @name        Ctrl+K to focus on search (currently only works on MDN)
// @namespace   Violentmonkey Scripts
// @description This is a userscript.
// @match       *://developer.mozilla.org/*
// @license     MIT
// @version     0.0.1
// @author      
// @require     https://cdn.jsdelivr.net/combine/npm/@violentmonkey/dom@2,npm/@violentmonkey/ui@0.7
// @grant       GM_addStyle
// ==/UserScript==

(function () {
'use strict';

document.addEventListener('keydown', e => {
  if (e.key === 'k' && e.ctrlKey) {
    e.preventDefault();
    e.stopPropagation();
    document.getElementById('top-nav-search-q').focus();
  }
});

})();