MaxSem has uploaded a new change for review.

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


Change subject: Rm old hack that disables site and user JS
......................................................................

Rm old hack that disables site and user JS

Not needed anymore as RL now honors targets

Change-Id: I1900a00c5e5d5aa54213ec4d401458afc1b83e9a
---
M includes/MobileContext.php
M tests/MobileContextTest.php
2 files changed, 0 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/59/77359/1

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index f5df79f..1a614a4 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -605,7 +605,6 @@
        public function getMobileUrl( $url, $forceHttps = false ) {
 
                if ( $this->shouldDisplayMobileView() ) {
-                       $this->disableIncompatibleJs();
                        $subdomainTokenReplacement = null;
                        if ( wfRunHooks( 'GetMobileUrl', array( 
&$subdomainTokenReplacement ) ) ) {
                                if ( !empty( $subdomainTokenReplacement ) ) {
@@ -856,19 +855,6 @@
                $parsedTarget = wfParseUrl( $url );
                $parsedServer = wfParseUrl( $wgServer );
                return  $parsedTarget['host'] === $parsedServer['host'];
-       }
-
-       /**
-        * This evil method disables JS known to be (or is potentially) 
incompatible with MF
-        *
-        * FIXME: We need to prevent things like Common.js from loading on the 
mobile site. Ultimately,
-        * this should be handled by ResourceLoader, but this nasty hack has 
been agreed upon as
-        * the quickest way forward at the moment. This should be removed ASAP.
-        */
-       private function disableIncompatibleJs() {
-               global $wgUseSiteJs, $wgAllowUserJs;
-               $wgUseSiteJs = false;
-               $wgAllowUserJs = false;
        }
 
        /**
diff --git a/tests/MobileContextTest.php b/tests/MobileContextTest.php
index 5d4ce98..d91c753 100644
--- a/tests/MobileContextTest.php
+++ b/tests/MobileContextTest.php
@@ -307,17 +307,6 @@
                $this->assertFalse( MobileContext::isLocalUrl( 
'http://www.google.com' ) );
        }
 
-       public function testDisableIncompatibleJs() {
-               global $wgUseSiteJs, $wgAllowUserJs;
-
-               $wgUseSiteJs = true;
-               $wgAllowUserJs = true;
-               $disablsIncompatibleJs = $this->getMethod( 
'disableIncompatibleJs' );
-               $disablsIncompatibleJs->invoke( MobileContext::singleton() );
-               $this->assertFalse( $wgAllowUserJs );
-               $this->assertFalse( $wgUseSiteJs );
-       }
-
        /**
         * @dataProvider addAnalyticsLogItemProvider
         */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1900a00c5e5d5aa54213ec4d401458afc1b83e9a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to