Search code examples
javascriptstocktwits

Implementing the StockTwits Widget over SSL without warnings


Trying to use the StockTwits Widget in a web page that is (and must remain) served over SSL.

Since the widget-loader.min.js script link was being called via http, I copied the code to our domain so it would be served over our SSL. Problem still not solved. Chrome 25 says my page "ran insecure content" and completely refused to run or even display the widget.

So I dug into the .js file and found this little bit:

m=b.ssl?"https://":"http://"

Figuring the warning was coming from the widgets CALL to the service, I hacked this line as follows:

// add one character    ↓
m=b.ssl?"https://":"https://"

Initially I thought I had success, because Chrome 25 loaded the widget! But my glee was short lived once I saw that the nice GREEN https:// in the address bar had changed to a yellow warning sign. Clicking it for info revealed a warning: "...displayed insecure content from http://assets1.stocktwits.net....". {darn}

Since the .js is secure, and the CALL to stocktwits is made with https thanks to the hack, I have to conclude that stocktwits either isn't able or configured to reply over HTTPS.

Do you have any experience with this widget, or see something I am not doing correctly? TIA.


Solution

  • We've fixed the widget to use protocol-less URLs now. Let us know if that fixes this issue for you.