1

I'm attempting to add a Stumbleupon Badge to our site though it seems Stumbleupon doesn't support HTTPS with their CSS.

Using the Stumbleupon Discovery Tool found here I choose any of the badges: https://www.stumbleupon.com/dt/badges/create

I'm then provided the Badge Code as shown here:

<!-- Place this tag where you want the su badge to render -->
<su:badge layout="2"></su:badge>

<!-- Place this snippet wherever appropriate -->
<script type="text/javascript">
  (function() {
    var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
    li.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//platform.stumbleupon.com/1/widgets.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
  })();
</script>

When attempting to load this code it shows the badge as a unstylized list. From researching the code it seems the JavaScript file loaded calls the CSS loading location which calls this file: http://cdn.stumble-upon.com/css/badges_su.css?v=20120613

As the JavaScript file is external it doesn't provide the ability to force the CSS as HTTPS.

Since we load our site on https:// any files that are loaded from http:// are blocked automatically on browsers that don't allow mixed content.

I've contacted Stumbleupon and they're apparently aware of the issue and don't plan on resolving it. (They don't seem to want to setup SSL)

Has anyone else encountered this mixed content problem with badges and if so has anyone found a work around? (Prefer code resolution not a plugin)

Matt S
  • 11
  • 2

1 Answers1

0

I was using a link Shortener that supports HTTPS for example https://goo.gl/ , but i never tested that with badges.

  • Sadly the CSS link is embedded in the external "widgets.js" so we aren't able to adjust the URL for the CSS file. It loads the following JS file: https://platform.stumbleupon.com/1/widgets.js The function I believe is on line 41-58 that calls the CSS Style Sheet but doesn't specify the URL. – Matt S Nov 22 '17 at 23:47