I'm trying to integrate Whatsapp button on my magento website.
I added the following code to my head.phtml
I get the following console error when I visit secure url pages because .js url is always http://
Mixed Content: The page at 'https://www.mywebsite......' was loaded over HTTPS, but requested an insecure script 'http://www.mywebsite..../whatsapp-button.js'. This request has been blocked; the content must be served over HTTPS.
Is there a way to get secure base url on secure pages and unsecure base url on unsecure pages?