diff --git a/includes/Content/GadgetDefinitionContentHandler.php b/includes/Content/GadgetDefinitionContentHandler.php index 1d63ef06..fb3fc52b 100644 --- a/includes/Content/GadgetDefinitionContentHandler.php +++ b/includes/Content/GadgetDefinitionContentHandler.php @@ -67,7 +67,7 @@ class GadgetDefinitionContentHandler extends JsonContentHandler { 'requiresES6' => false, 'hidden' => false, 'skins' => [], - 'targets' => [ 'desktop' ], + 'targets' => [ 'desktop', 'mobile' ], 'actions' => [], 'category' => '', 'supportsUrlLoad' => false, diff --git a/includes/Gadget.php b/includes/Gadget.php index 4ec2683b..7d8f02fc 100644 --- a/includes/Gadget.php +++ b/includes/Gadget.php @@ -59,7 +59,7 @@ class Gadget { /** @var string[] */ private $requiredSkins = []; /** @var string[] */ - private $targets = [ 'desktop' ]; + private $targets = [ 'desktop', 'mobile' ]; /** @var bool */ private $onByDefault = false; /** @var bool */ diff --git a/tests/phpunit/unit/GadgetTest.php b/tests/phpunit/unit/GadgetTest.php index fff1b61e..b9ba5909 100644 --- a/tests/phpunit/unit/GadgetTest.php +++ b/tests/phpunit/unit/GadgetTest.php @@ -143,7 +143,7 @@ class GadgetTest extends MediaWikiUnitTestCase { public function testTargets() { $g = GadgetTestUtils::makeGadget( '*foo[ResourceLoader]|foo.js' ); $g2 = GadgetTestUtils::makeGadget( '*bar[ResourceLoader|targets=desktop,mobile]|bar.js' ); - $this->assertEquals( [ 'desktop' ], $g->getTargets() ); + $this->assertEquals( [ 'desktop', 'mobile' ], $g->getTargets() ); $this->assertEquals( [ 'desktop', 'mobile' ], $g2->getTargets() ); }