Ticket #11077 (closed PLIP: invalid)
Remove form unload protection
Reported by: | smcmahon | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.1 |
Component: | JavaScript | Version: | |
Keywords: | form unload formunload | Cc: |
Description (last modified by smcmahon) (diff)
This plip is still being researched.
Proposed by Steve McMahon
Motivation
Plone has a JavaScript event handler for the window.beforeunload that is intended to catch cases where a user might be accidentally leaving the page with a form unsubmitted.
The code for this is a mishmash of some five-year old tricky javascript with a bit of jQuery. It makes no provision for translation of the dialog message and has been the source of a great many bugs and fixes.
It also may be entirely unnecessary. Every modern browser (I checked back to IE 6) appears to have some sort of form protection of its own.
(I noticed this while cleaning up formUnload.js for PLIP 10901, js standardization. The code was never activated under common circumstances.
Proposal
Eliminate it!
Implementation
Remove formUnload.js from our plone_ecmascripts; change the Plone profile to not install it in the js registry; add migration step to remove it from js registry.
Deliverables
Updated plone_ecmascripts folder; updated GS profile; migration step.
Risks
Code side effects should be minimal or nonexistent, as formunload.js does not put any globals into the js namespace. Will need to make sure that unlock code doesn't somehow require it.
And, if browser coverage for this functions is not as good as my research indicates, some users will be left without form unload protection.
Participants
- Steve McMahon