问题
Twitter client (formerly Tweetie) allows you to define a bookmarklet in Safari that launches the app. I want to know which iPhone API allows you to register the protocol specifier (or whatever it's called) - in this case "tweetie:" - in order for this bookmarklet to work.
The instructions can be found here and the bookmarklet itself is below.
javascript:window.location='tweetie:'+window.location
Clicking the above bookmark is the same as typing in "tweetie:http://google.com" into the address bar. This is obviously supported on the OS/Browser level, much the same as tel:
URIs. Am I correct in understanding that developers can add arbitrary URI protocol specifiers as a part of app installation?
来源:https://stackoverflow.com/questions/2919472/how-does-twitter-for-iphone-bookmarklet-work