How to insert something right after <head>?

The browser doesn’t really care whether the script tag is added right after the opening <head> tag or right before the closing </head> tag. It will load it anyway and the result would be the same. The only thing that this affects is execution order (which doesn’t really matter in your case).

Further, your users also wouldn’t care about that since the <head> tag is not supposed to contain any user content (text, images, etc…) and is to set display: none in all browsers.

Please try to add your script tag to the </head> tab in your component and then whitelist the source of that script in CSP. If you run into any problems related to that, we can help :+1:

6 Likes