Clean GitHub URLs

Remove tab parameters from GitHub URLs

// ==UserScript==
// @name        Clean GitHub URLs
// @namespace   felixhummel
// @match       *://github.com/*
// @grant       none
// @version     1.0
// @author      Felix Hummel
// @description Remove tab parameters from GitHub URLs
// @license MIT
// ==/UserScript==
(function() {
    'use strict';

    const url = new URL(window.location.href);
    if (url.searchParams.has('tab')) {
        url.searchParams.delete('tab');
        window.history.replaceState({}, document.title, url.toString());
    }
})();