ShareThis buttons not clickable on HTTPS website
Asked Answered
P

2

5

I have added "share this" buttons to my secure site and now they produce an error when clicked. Errors are mentioned below. Has anyone had this problem before?

Blocked loading mixed active content "http://w.sharethis.com/button/buttons.js"

ReferenceError: stLight is not defined

Loading mixed (insecure) display content on a secure page "http://w.sharethis.com/images/facebook_32.png"

Pentagram answered 14/1, 2014 at 16:8 Comment(0)
K
12

Basically if a page is loaded over HTTPS then every resource it uses should also be loaded over HTTPS. It's a part of browser security policy, just like Same-Origin Policy etc.

Fortunately ShareThis can be used over HTTPS like this:

<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">
    stLight.options({
        publisher:'12345',
    });
</script>

Same applies to your facebook icon. Just use this URL: https://ws.sharethis.com/images/facebook_32.png

Kohinoor answered 14/1, 2014 at 16:9 Comment(3)
@Pentagram did you tried the solution I suggest? Do you need some additional clarification?Kohinoor
their certificate is invalidPhobe
@MichaelJohnston - Note that the domain also has to be changed (ws.sharethis.com/button/buttons.js) - ws instead of s.sharethis.com. See [this support article|support.sharethis.com/hc/en-us/articles/…. Probably some dumb legacy CDN reason why they can't just use the same domain with https:// :PCalcific
K
1

Also for those that are having trouble debugging this stuff make sure to check out that your browsers aren't blocking ShareThis through an add-on.

Ref: stLight not defined issue related to addons

Khaddar answered 26/11, 2014 at 19:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.