Last active
February 20, 2023 09:37
-
-
Save strokirk/15e906026ef92177054fd354e57a1f0d to your computer and use it in GitHub Desktop.
UserScript to make Bitbucket PR tab titles more information dense
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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