block-explorer icon indicating copy to clipboard operation
block-explorer copied to clipboard

Fix insecure images

Open NetOpWibby opened this issue 6 years ago • 0 comments

On the homepage, there are links served from insecure domains. This makes the padlock in Firefox's URL bar gray with a caution sign.

Here's a function I made for .tech:

function makeImageSourceSecure(url) {
  const originalUrl = new URL(url);

  if (originalUrl.protocol !== "https")
    return `https://${originalUrl.host}${originalUrl.pathname}`;

  return originalUrl.href;
}

NetOpWibby avatar Feb 19 '19 22:02 NetOpWibby