Is there a way to get all registered protocol handlers in JS?

349 views Asked by At

So I'm trying to make a web app that basically serves as a URL shortener, where I can use a custom protocol with navigator.registerProtocolHandler (I know that this isn't a very good idea for various reasons, but I just want to try messing around with it). For example, web+yt: redirects me to YouTube, and web+yt:htb redirects me to HowToBasic's channel. This works so far, but the question is if there's a way to query which protocol handlers have been registered? There's also the navigator.unregisterProtocolHandler function to unregister them, but I cannot find anything about a listing function. I could store it into a cookie or localStorage, but if I clear the website data I'd have to guess which ones are registered, which isn't a really good solution. Do you guys know any solutions? Thanks

0

There are 0 answers