Testing service workers on custom local domain with self signed certificate

When playing around with service workers in order to make a site a progressive web app I had to test it on my local dev environment. As service workers need to run on https and I use a self-signed certificate for development. This gave me the following error in the console in Chrome

ServiceWorker registration failed: DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.

The solution is to tell Chrome to accept the certificate even though it is insecure from Chrome’s point of view.

Read more

Create Application Shortcut in Chrome on Mac

Once upon a time there was an easy way to create application shortcuts in Chrome on Mac. However, in recent versions of Chrome this functionality has disappeared. Luckily it is pretty simple to reenable it. Here are the steps to do so:

Type chrome://flags in Chrome’s address bar.

Make sure the following are enabled:

  • The new bookmark app system
  • Allow hosted apps to be opened in windows
  • Creation of app shims for hosted apps on Mac
  • Quit notification for hosted apps

It should look like this:

chrome-flags

Restart the Chrome (in the bottom of the page)

Now visit the website or app you want to add a shortcut to and press the three dots in the top far right of Chrome.

Read more