custom-protocol-detection icon indicating copy to clipboard operation
custom-protocol-detection copied to clipboard

More reliable pre-Windows 8 IE checks if navigator.userAgent can also be set by custom protocol handler

Open shoe54 opened this issue 8 years ago • 2 comments

Check for custom identifier in navigator.userAgent in pre-Windows 8 IE tests. This works if your custom protocol handler had the ability to add a custom string to the IE userAgent via the Windows registry.

See https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx

shoe54 avatar Aug 19 '16 07:08 shoe54

Thanks for the pull request!

Shouldn't a user agent check (if we want that) be applied at the top level instead of within a specific function? Probably we also want to define something more than just a :// unless it's something standard, which I can't find on the link you provided.

ismailhabib avatar Aug 25 '16 08:08 ismailhabib

Sorry for the late reply.

My implementation was specific to IE only. E.g. the navigator.userAgent test doesn't work on Chrome.

The implementation uses substr to extract the part before :// from the URI and uses that to compare with navigator.userAgent. So for example if you are testing customprotocol://test , the implementation will look for 'customprotocol' within the userAgent.

shoe54 avatar Aug 29 '16 07:08 shoe54