Last active
August 12, 2016 09:00
-
-
Save keymon/aa314cdc0b89dc1b62b73fd208385404 to your computer and use it in GitHub Desktop.
Userscript to disable the Merge button inside pull requests on certain github projects
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 Hide GitHub Merge Button | |
// @version 0.4 | |
// @description Removes the merge button on a GitHub project, so you will remember to | |
// rebase/write a useful merge message. | |
// @match https://github.com/alphagov/paas-cf/pull/* | |
// @grant GM_addStyle | |
// ==/UserScript== | |
var main = function () { | |
var clearMergeButton = function() { | |
document.querySelector('.js-merge-branch-action').style.display = 'none'; | |
}; | |
setTimeout(clearMergeButton, 500); | |
// Merge button gets reset after you add a comment for some reason, so hide it then too | |
form = document.querySelector('form.js-new-comment-form') | |
form.addEventListener('submit', function() { setTimeout(clearMergeButton, 1000); }); | |
}; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this user-script by: