// ==UserScript== // @name GitLab Plus // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description try to take over the world! // @author You // @match https://gitlab.*/*/commit/* // @grant none // @downloadURL none // ==/UserScript== (function() { // 'use strict'; var plus = { link_to: function(url, text) { return $('').attr('href', url ).html(text) }, }; let bc = $('.breadcrumbs-list'); let currentId = $('.breadcrumbs-list li:nth-child(4) a').text(); bc.append( plus.link_to('../compare/master...' + currentId, 'diff to master') ); bc.append('   |   '); bc.append( plus.link_to('../compare/' + currentId + '...master', 'diff by master') ); })();