@serenity-is/corelib / jQueryPatch
Function: jQueryPatch()
jQueryPatch():
boolean
Defined in: src/compat/jquery-compat.ts:101
Applies legacy jQuery compatibility patches to the globally registered jQuery instance.
Patches applied (when applicable):
- jQuery UI Dialog fixes — allows interaction with overlays such as dropdowns, datepickers, Select2, CKEditor and modals; suppresses tabbable focusing in mobile view; injects a FontAwesome close icon into the title bar.
- cleanData patch — invokes invokeDisposingListeners and any
disposingevent handlers before the original$.cleanData, then polyfills$.toJSON/$.parseJSONwhen missing. - CSRF token hook — registers a global
beforeSendvia$.ajaxSetupthat attaches theCSRF-TOKENcookie asX-CSRF-TOKENon same-origin requests.
This is a compatibility shim for legacy pages that still load jQuery / jQuery UI. New code should avoid a jQuery dependency.
Returns
boolean
true if a jQuery instance was found and patches were applied; false if no jQuery is registered.