Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RequireJsDefinitions.php
Go to the documentation of this file.
1 <?php
8 
9 use Facebook\WebDriver\Exception\UnexpectedAlertOpenException;
10 
17 {
24  protected function doesMetricPass($value)
25  {
26  return $value === null;
27  }
28 
35  protected function fetchValueFromPage()
36  {
37  $script =
38  'if (!window.requirejs) {
39  return null;
40  }
41  var contexts = window.requirejs.s.contexts;
42  for (var label in contexts) {
43  if (contexts.hasOwnProperty(label)) {
44  var registry = contexts[label].registry;
45  for (var module in registry) {
46  if (registry.hasOwnProperty(module) && registry[module].enabled) {
47  return module;
48  }
49  }
50  }
51  }
52  return null;';
53 
54  $moduleInProgress = $this->executeJS($script);
55  if ($moduleInProgress === 'null') {
56  $moduleInProgress = null;
57  }
58  return $moduleInProgress;
59  }
60 }
$value
Definition: gender.phtml:16