Status: In Development
Affects Version/s: None
Fix Version/s: None
Component/s: JS APIs and Utilities
On march 2020, chomium launched a proposal to deprecate browser native dialogs alert(), confirm() and prompt(), when the code creating them runs embedded in a frame and was loaded from a different origin than the host page. Proposal led to a big discussion about the apropriateness of removing such support, still active at the time of this writing.
Current situation can be summarized as follows:
- HTML live spec already includes this constraint since early 2021
- Chromium added this under a feature flag right after, rolled it out in july 2021 and reverted one month later, postponed to January 2022 as per the complaints
- Liferay DXP platform makes use of such functions in some cases
As a result, once chrome rolls out this, customers rendering Liferay in a cross-domain iframe would not get browser native dialogs rendered. This will break some DXP features.
The goal of this epic is to design and implement alert and confirmation dialogs that substitute the native ones, so that DXP can render properly both in the main frame and within a cross-domain iframe.
- DXP provides globally available functions to substitute the existing ones. These should be included in all served pages so that they can be called from anywhere in DXP codebase
- All occurrences of browser native dialogs alert(), confirm() and prompt() in DXP codebase are properly substituted with the new functions
- New functions must offer a similar UX as the existing ones.
- Solution must not cause side effects on DXP applications, regardless of how the DXP app is being rendered. This includes, but is not limited to:
- CSP configurations needed to execute the functions
- Native functions block the JS main thread. New solution may not be doing this in all cases
- Solution must work for all liferay versions with active Premium Support. As per this list, this includes Liferay 7.1 onwards
- To enable a smooth transtion, new functions will be gated trhough a FF so that they can behave like the traditional dialogs