Our monkey-patch methods keep a copy of the original unpatched function at hand to reinstate them via our unpatch methods if the user temporarily disables Web2Cit.
However, I think this unpatching may conflict with other user scripts monkey-patching the same functions. For example:
- our user script monkey-patches $.ajax and saves a copy of the original function at this.unpatched.ajax.
- some other user script monkey-patches $.ajax again; that is, our version of it. This should be OK.
- the user decides to temporarily disable Web2Cit, so our unpatch method reinstates the original unpatched $.ajax. Then, the monkey-patch applied by the other user script is lost.
Consider deprecating our unpatch methods and having an enabled flag that is read to decide (inside our patches) whether our custom code should be run or skipped.