'Turning off the async attribute in MediaWiki resource loader script tag

I have a dependency, and I think the asynchronous loading of MediaWiki resources (jQuery specifically) is causing a problem. Is there a way to switch off this attribute in a MediaWiki setting?enter image description here



Solution 1:[1]

I solved this by copying the structure of a jQuery dependency in resources/Resources.php with the resource I wanted to include and uploaded the .js file to the specified folder.

Then added the following code to LocalSettings.php:

$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
  $out->addModules('mymodule');
  return true;
};

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zach Jensz