custom-protocol-detection

WebJar for custom-protocol-detection

License

License

MIT
Categories

Categories

IDE Development Tools Github Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-ironexmaiden-custom-protocol-detection
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

custom-protocol-detection
WebJar for custom-protocol-detection
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ironexmaiden/custom-protocol-detection

Download github-com-ironexmaiden-custom-protocol-detection

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-ironexmaiden-custom-protocol-detection/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-ironexmaiden-custom-protocol-detection</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-ironexmaiden-custom-protocol-detection/
implementation 'org.webjars.npm:github-com-ironexmaiden-custom-protocol-detection:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-ironexmaiden-custom-protocol-detection/
implementation ("org.webjars.npm:github-com-ironexmaiden-custom-protocol-detection:1.0.1")
'org.webjars.npm:github-com-ironexmaiden-custom-protocol-detection:jar:1.0.1'
<dependency org="org.webjars.npm" name="github-com-ironexmaiden-custom-protocol-detection" rev="1.0.1">
  <artifact name="github-com-ironexmaiden-custom-protocol-detection" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-ironexmaiden-custom-protocol-detection', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "github-com-ironexmaiden-custom-protocol-detection" % "1.0.1"
[org.webjars.npm/github-com-ironexmaiden-custom-protocol-detection "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Custom Protocol Detection in Browser

Detect whether a custom protocol is available in browser (FF, Chrome, IE8, IE9, IE10, IE11, and Edge)

The implementation is different from one browser to another, sometimes depend on which OS you are. Most of them are hacks, meaning that the solution is not the prettiest.

  • Firefox: try to open the handler in a hidden iframe and catch exception if the custom protocol is not available.
  • Chrome: using window onBlur to detect whether the focus is stolen from the browser. When the focus is stolen, it assumes that the custom protocol launches external app and therefore it exists.
  • IEs and Edge in Win 8/Win 10: the cleanest solution. IEs and Edge in Windows 8 and Windows 10 does provide an API to check the existence of custom protocol handlers.
  • Other IEs: various different implementation. Worth to notice that even the same IE version might have a different behavior (I suspect due to different commit number). It means that for these IEs, the implementation is the least reliable.

Known Issues

  • In some protocol such as "mailto:", IE seems to trigger the fail callback while continuing on opening the protocol just fine (tested in IE11/Win 10). This issue doesn't occur with a custom protocol.
  • Edge, in contrast, never fail anything as it will just offer users to find an app in Windows Store to open an unknown protocol.

Versions

Version
1.0.1