User:SoledadKabocha/betterCancel-vector

This script is the same as cancelRedirectNo, except that it also optionally forces the "Cancel" link to cancel the editing session without displaying any warning about unsaved changes, and it provides an option to make the "Cancel" link go back to the section that was being edited if any.

Despite its name, it is not actually specific to the Vector skin, as setting a no-op  function on the cancel link should be harmless under any skin.

The original cancelRedirectNo is deprecated because it unnecessarily uses the API to determine whether a page is a redirect.

This script currently has no effect in VisualEditor, because I haven't yet figured out the proper way to detect clicks on VisualEditor's Cancel button.