Summary
We need a way to know if the MobileFrontend editor could be loaded for a given page for T407377: hCaptcha: Create front-end JS configuration variable that indicates whether an edit to the given page would require hCaptcha completion.
Background
- ConfirmEdit (CAPTCHA extension) needs to add a JS configuration variable which will be used early in the MobileFrontend edit cycle
- Therefore, this needs to be loaded on page views and as such we will be using a hook (MakeGlobalVariablesScript) which is documented as expensive due to the content in it being sent back before the page content
- We therefore should not load the JS configuration variable unless it definitely could be needed
- This includes not adding the variable if MobileFrontend is not available for the current page view but still installed
- Currently only a MobileFrontend static protected function can be used to determine this
- While we could replicate the logic in ConfirmEdit (CAPTCHA extension), it seems more stable to add this static method in some kind of service in a non-static way
Acceptance criteria
- A method exists to know if MobileFrontend could be used in the page returned for a given request, that ConfirmEdit (CAPTCHA extension) can make use of for T407377