How to serve a TimelineJS iframe over a secure HTTPS connection

A minor niggle, but one that it took me an inordinate amount of time to find the answer to today – if you’re using Knight Labs’ excellent Timeline JS plugin to power an interactive timeline on your site, you’ll find the iframe loads over a standard HTTP connection – so if your site HTTPS, the iframe won’t load and you’ll be left with a giant void where your lovely timeline would have been.

Unfortunately Knight Labs themselves don’t offer an option to serve the timeline over HTTPS, so you need to be a bit sneaky and use the full URL of the embedded widget which, thankfully, is hosted on an Amazon S3 bucket and can be accessed over a secure connection.

Basically – and it’s actually a really simple fix – you need to append https://s3.amazonaws.com/ to the source URL in your iframe code. The provided address for the embed is:

http://cdn.knightlab.com/libs/timeline/latest/embed

Which you need to edit to become:

https://s3.amazonaws.com/cdn.knightlab.com/libs/timeline/latest/embed/

So simply do a find + replace for “http://cdn.knightlab.com/” to “https://s3.amazonaws.com/cdn.knightlab.com/” and you should find your timelines loading over an HTTPS connection with no problem.

The same rules apply for other Knight Labs tools, like StoryMap or Juxtapose, meaning you can serve things like before and after pictures of your dog’s haircut…

…over a secure connection.

You can see the full, annoying-to-find-on-Google discussion thread on the issue here.

2 thoughts on “How to serve a TimelineJS iframe over a secure HTTPS connection

  1. Hello,

    where can I change this code? I’m currently looking on my domain under /public_html/sites/all/modules/views_timelinejs but I can’t find the links. Do I have to change this in the drupal site itself?

  2. hOur company offers supreme quality general health products. Visit our health contributing website in case you want to feel better. Our company provides generic supplements. Look at our health contributing portal in case you want to strengthen your health. Our company provides health and related products. Visit our health contributing website in case you want to look better. Our company offers health and related products. Take a look at our health contributing portal in case you want to look healthier. Our company offers herbal health and related products. Look at our health contributing website in case you want to look better. Our company provides a wide variety of non prescription drugs. Visit our health site in case you want to strengthen your health with a help generic supplements.
    Our company provides a wide variety of non prescription products. Visit our health site in case you want to to feel healthier. Our company offers herb-based weight loss products. Visit our health contributing website in case you want to improve your health. Our company provides a wide variety of non prescription products. Take a look at our health contributing portal in case you want to look better. Our site offers a wide variety of non prescription drugs. Visit our health portal in case you want to to feel healthier with a help health products. Our company provides a wide variety of non prescription products. Take a look at our health website in case you want to feel better with a help of health products.

Leave a Reply

Your email address will not be published. Required fields are marked *