Skip to content

Instantly share code, notes, and snippets.

@strokirk
Last active February 20, 2023 09:37
Show Gist options
  • Select an option

  • Save strokirk/15e906026ef92177054fd354e57a1f0d to your computer and use it in GitHub Desktop.

Select an option

Save strokirk/15e906026ef92177054fd354e57a1f0d to your computer and use it in GitHub Desktop.
UserScript to make Bitbucket PR tab titles more information dense
// ==UserScript==
// @name Bitbucket PR Title
// @namespace https://gist.github.com/strokirk
// @version 1.0
// @description Make Bitbucket PR tab titles more information dense
// @author Dan Strokirk
// @match https://bitbucket.org/*/pull-requests/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bitbucket.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Grab everything after the "owner / project / Pull Request #" mark
const TITLE_REGEXP = /^([^/]*\/){2} Pull Request #(.*)$/
// Allow the Bitbucket SPA time to update the document.title before we run our script
setTimeout(shortenTitle, 700)
function shortenTitle() {
document.title = "PR" + TITLE_REGEXP.exec(document.title)[2]
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment