src/Widget/Injector/HtmlInjector.php
/**
     * insert some HTML before the first javascript include in the page.
     * If there is no JS anywhere, place it right after start of body.
     */
insert some HTML before the first javascript include in the page.
If there is no JS anywhere, place it right after start of body.
insert some HTML before the first javascript include in the page . If there is no JS anywhere place it right after start of body .
protected function jsTagsBefore(string $snippet, string $rawHtml): string
    {
        $result = self::injectBeforeTagStart($rawHtml, 'script', $snippet);
        if ($result === $rawHtml) {
            $result = self::injectAfterTagStart($rawHtml, 'body', $snippet);
        }
        return $result;
    }
protected function jsTagsBefore ( string $ snippet , string $ rawHtml ) : string { $ result = self :: injectBeforeTagStart ( $ rawHtml , 'script' , $ snippet ) ; if ( $ result === $ rawHtml ) { $ result = self :: injectAfterTagStart ( $ rawHtml , 'body' , $ snippet ) ; } return $ result ; }
insert some HTML before the first javascript include in the page.
insert some HTML before the first javascript include in the page .