Deactivating HTTPS for localhost for Chrome

I recently got a new company laptop. While this is generally great news, it means to go through a lot of configurations to adopt the standard image to my needs. One thing I noticed was that after installing a local http server, that Chrome won’t connect to http://localhost:8080, but instead goes to https://localhost:8080. Chrome loves security so much, that is switches to TLS even on a localhost connection. Now, this is not exactly how I can work. I cannot – but would love to – install a valid TLS certificate on all my localhost web servers. This is too much work and most of those servers are short living.

How can you disable the automatic switch to TLS done by Chrome?

It seems that this comes from HTST. Therefore, creating an exception is enough to not let Chrome make this TLS switch again.

First, check if HTST is active for localhost

  1. Access chrome://net-internals/#hsts in Chrome

  2. Go to query domain and search for localhost

  3. Check the result. If you get some results, HTST is active for localhost

Deactivate HTST for Localhost

  1. Access chrome://net-internals/#hsts in Chrome
  2. In the delete domain section, insert localhost

  3. Validate the deletion by searching again for localhost. You should new get not found.

SAP UI5 VIZ charts in Chrome

I was preparing a demo showing how to visualize data from an IoT service using SAP UI5 VisFrame charts. To play around with VizFrame, I used the sample from SAPUI5 SDK. It was working perfectly on the online version, but while running the UI5 app and Chrome, I got an error message.

Googling for the error message revealed that with Chrome 50 a known error exists which makes it impossible to use a VizFrame chart. Luckily I found the solution on SCN. All it takes is to implement the function as a prototype and the chart will work.

SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); };

I`ve put the code in my views controller init() function:

onInit : function (evt) {
  SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); };
  oVizFrame = this.oVizFrame = this.getView().byId("idVizFrame");

Result

Now, this works magically when I access the online SDK, but is broken when using it locally. I guess SAP did some magic either in the SDK or in the UI5 library that my SAPUI5 version does not include. Either way, the above trick solves the problem.

Delete cookies in Chrome

Working with HTML5 and a lot with SAP means that sooner or later I will have to delete cookies. CTRL+SHIFT+N helps, but from time to time my cookies in normal browser mode are a total mess. When I used to use Firefox for web development, I had Firebug and plugins installed to handle cookies. Chrome has this built-in. In the URL bar, enter:

chrome://settings/cookies

This opens the cookie manager of Chrome.

Deleting all cookies or a single one: it’s just a click!