Just wondering how following happens, maybe someone knows:
Like known I remove unwanted Joomla scripts in common ways like using:
$this->_script = $this->_scripts = array();
or in single ways:
but I have a Joomla site were this has no effect nevertheless scripts were loaded. Also to get scripts via a second way has no success:
$document = JFactory::getDocument(); $headData = $document->getHeadData(); $scripts = $headData['scripts'];
when I check scripts just before load in both cases scripts are empty and than of course cannot unset but they are loaded with the HeadRenderer of Joomla.
I can solve this with copy, edit and loading my own file based on: \libraries\src\Document\Renderer\Html\HeadRenderer.php
but I'm really interested what happens here, it doesn't matter if I load a custom template or use a Joomla (Protostar) one by only changing to unset scripts. Same problem scripts are empty via $this or getDocument(); but loaded in to the head html via
<jdoc:include type="head" />
Somehow the scripts are not loaded during Template Rendering but with the HeadRendering? Tried with disable any third party modules and plugins but no change ... Big question mark for me? Any ideas?