Skip to content

Instantly share code, notes, and snippets.

@cmcnulty
cmcnulty / unsubscribe-madison-com.user.js
Last active October 10, 2019 04:26
Greasemonkey script to disable madison.com subscription redirect
// ==UserScript==
// @name Madison.com NonSubscribe
// @description Stops subscription redirect on madison.com articles
//
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @license (CC); http://creativecommons.org/licenses/by-nc-sa/3.0/
//
// @namespace NonSubscribe.me
// @include http://*.madison.com/*
// @updateURL https://gist.githubusercontent.com/cmcnulty/11194631/raw/unsubscribe-madison-com.user.js
@cmcnulty
cmcnulty / jquery.fireOnDisable.js
Last active July 26, 2019 07:48
Allows you to listen for propertychange on setting disabled to true on form elements. Very useful for resolving some select2 issues.
( function( $ ) {
"use strict";
$.fn.fireOnDisable = function( settings ) {
// Only perform this DOM change if we have to watch changes with propertychange
// Also only perform if getOwnPropertyDescriptor exists - IE>=8
// I suppose I could test for "propertychange fires, but not when form element is disabled" - but it would be overkill
if( !( 'onpropertychange' in document.createElement( 'input' ) ) || Object.getOwnPropertyDescriptor === undefined ) {
return this;
}