Page MenuHomePhabricator

Standardise "This page requires JavaScript / Unsupported browser" message for js-only features
Open, LowPublic


Several extensions don't work if JavaScript isn't enabled (I think the list includes ApiSandbox, BetaFeatures, ContentTranslation, EtherEditor, PageTriage, ...) and each has its own way to show it.

There could be a

  • a core message (T21449 ?)
  • a function to check for JS and output this error, outputPage->jsRequired( $appendText )
  • a way to specify that a SpecialPage requires JS

It's not that simple, because I think most or all MW code that requires JavaScript actually requires JavaScript enabled in a browser that ResourceLoader supports (the test isCompatible() in startup.js). So as well as printing

<noscript><div class="errorbox"This tool requires JavaScript enabled in a not-too-old browser.</div></noscript>

the PHP jsRequired() would also need to invoke a basic

if ( !isCompatible() ) { showErrorbox( 'This tool does not work in your browser' ); }

function provided by startup.js

Event Timeline

Spage raised the priority of this task from to Low.
Spage updated the task description. (Show Details)
Spage added subscribers: Spage, Krinkle.
Krinkle renamed this task from Handle "This page requires JavaScript" (... and ResourceLoader support) errors to Standardise "This page requires JavaScript / Unsupported browser" message for js-only features.Sep 25 2015, 2:00 AM
Krinkle edited projects, added MediaWiki-Interface; removed MediaWiki-ResourceLoader.
Krinkle set Security to None.

This isn't an issue for ResourceLoader as a framework since ResourceLoader doesn't build interfaces or pages. It provides the client-js/client-nojs css classes. It is up to MediaWiki to come up with an interface and utilise that class to make it visible when appropriate.