Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Userscript to intercept the "publish release" button on Github to make sure the presser of said button is sure they want to press it
// ==UserScript==
// @name Github Release, are you sure??
// @version 0.1
// @description That green "Publish Release" button is just far too tempting to press when you want to save a draft.
// @author @promofaux
// @include *://*
// @icon
// @grant none
// @require
// ==/UserScript==
(function($) {
'use strict';
function init() {
// from
var btn = $("button.js-publish-release");"funcToCall", btn.attr("onclick"));
btn.bind("click", function(e){
if (confirm("Are you sure?")){
var func = $(this).data("funcToCall");
return false;
document.addEventListener("pjax:end", init);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment