Last active
August 23, 2017 21:09
-
-
Save Asuza/53dbea445c96a1b171108e4aeaafc01e to your computer and use it in GitHub Desktop.
This file contains 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 Example Script | |
// @match https://site.com/wildpath* | |
// @match https://site.com/specificpath | |
// ==/UserScript== | |
(function ($) { | |
/** | |
* Processes all successful AJAX calls | |
* @param {Object} event | |
* @param {Object} jqXHR | |
* @param {Object} options | |
* @param {Object} data Response data | |
*/ | |
function processResponse (event, jqXHR, options, data) { | |
if (/route\/and\/data\.json/.test(options.bareUrl)) { | |
// process url | |
} else if (/neato\.json/.test(options.bareUrl)) { | |
// process other url | |
} | |
} | |
$(document).bind("ajaxSuccess", processResponse); | |
})(unsafeWindow.jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment