Comments on: Application-Specific Links https://css-tricks.com/application-specific-links/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Wed, 01 Sep 2021 04:57:01 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Kyrodes https://css-tricks.com/application-specific-links/#comment-1781922 Wed, 01 Sep 2021 04:57:01 +0000 https://css-tricks.com/?p=350690#comment-1781922 You can use the console to create new URL schemes in Firefox but it needs to be web+yourscheme

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler

Then you can setup the scheme to open whatever app you want in about:preferences > Applications

You can modify the existent URL schemes too. For example: I modified “tel:” to open phone numbers in Whatsapp web, like this: https://web.whatsapp.com/send?phone=%s

That way I can type tel:99999999 and send a message to a number without even having to add the contact to my phone book.

]]>
By: Jakob https://css-tricks.com/application-specific-links/#comment-1781914 Tue, 31 Aug 2021 19:49:55 +0000 https://css-tricks.com/?p=350690#comment-1781914 The new Chromium Edge has one of these protocols – microsoft-edge: Which will open a link in an Edge window.

This is useful because with IE11 sunsetting now, and Edge being a viable alternative, you can check to see if the browser is running IE 11, and then automatically open the page in Edge, where it would be properly supported. Here’s a little snippet that does that.

// First check if the user agent is Trident (IE)
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {

  // We are going to take the current url, and use the edge protocol to bounce the url to Edge.
  window.location = 'microsoft-edge:' + window.location; 

  // After a short timeout (long enough to process the prior request) we are then going to redirect the IE window to a generic microsoft landing page.
  setTimeout(function() { 
    window.location = 'https://go.microsoft.com/fwlink/?linkid=2135547';
  }, 1);
}

IE 11 is already behaving similar to this when it handles youtube, facebook, or other big websites (if you still have IE11 try loading one of these sites in that browser. I would still use the following with caution, as I’m still not certain this is good to use in production, though if the browser is already doing something like this natively, then it may be fine.

]]>