Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312935

Change subject: POC: UCMini browser should behave correctly as a NORLQ client
......................................................................

POC: UCMini browser should behave correctly as a NORLQ client

Change-Id: I65b1ea277214b7108ba1dc24ac61efa8a598f9b5
---
M includes/resourceloader/ResourceLoaderClientHtml.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/312935/1

diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php 
b/includes/resourceloader/ResourceLoaderClientHtml.php
index 5729218..2496440 100644
--- a/includes/resourceloader/ResourceLoaderClientHtml.php
+++ b/includes/resourceloader/ResourceLoaderClientHtml.php
@@ -261,9 +261,11 @@
                // Change "client-nojs" class to client-js. This allows easy 
toggling of UI components.
                // This happens synchronously on every page view to avoid 
flashes of wrong content.
                // See also #getDocumentAttributes() and 
/resources/src/startup.js.
+               // When doing this we should be sure that async loading is 
supported to avoid unexpected rendering issues.
+               // The UCMini browser although claiming support with async 
attribute doesn't seem to work so we also have to browser sniff.
                $chunks[] = Html::inlineScript(
-                       'document.documentElement.className = 
document.documentElement.className'
-                       . '.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" 
);'
+                       'if ( "async" in document.createElement("script") && 
navigator.userAgent.indexOf( "U; " ) === 0 ) { 
document.documentElement.className = document.documentElement.className'
+                       . '.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" 
); }'
                );
 
                // Inline RLQ: Set page variables

-- 
To view, visit https://gerrit.wikimedia.org/r/312935
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65b1ea277214b7108ba1dc24ac61efa8a598f9b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to