GitHub shorter title edited files

Change title edited file in editor to filename.

// ==UserScript==
// @name            GitHub shorter title edited files
// @description     Change title edited file in editor to filename.
// @author          hawkeye116477, krystian3w
// @namespace       https://greasyfork.org/users/167625
// @icon            https://i.imgur.com/KmWlHbe.png
// @match           https://github.com/*/*/edit/master/*
// @version         1.0.5
// @grant           none
// @run-at          document-idle
// @compatible      firefox Firefox
// @compatible      chrome Chrome
// @compatible      edge Edge
// ==/UserScript==

const elementsGitHub = document.getElementsByClassName("js-blob-filename");
if (elementsGitHub.length > 0) {
    document.title = elementsGitHub[0].value;
} else {
    document.title = document.querySelectorAll('[aria-label="File name"]')[0].value;
}