Javascript In Order Confirmation And Products Pages Top Header


I'm creating an addon and I need to have some javascript in order confirmation and products pages top header. So I have read the documentation and I have come up with this.

for the order confirmation page I have create this file:


and added some script like so:

for the product page I have create this file:
but unfortunately this do not show up on top header page but in the middle, even with "data-no-defer" added according to the documentation.
Any one know exactly what files I need to use to add the script for this?
Thanks for any help.

In this case use index:head_scripts hook and check location by $runtime.controller and $runtime.mode

Perfect, thank you very mush for you help!