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 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 |
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
( 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; | |
} |