Closed christianbundy closed 5 years ago
Code looks fine to me. Is the idea that we can introduce more handlers, like dat: in the future?
I'm sure that's possible, but this wasn't written with that in mind. The idea is just to support the URI form rather than just sigil links, although I suppose we could register a protocol handler so that clicking SSB links on the web would open Patchwork or Patchbay.
Haven't tested this in live app but looks good to me!
there's a minor change I mentioned about that you can fix in master if you think it's worth it
p.s. great work @christianbundy , so good to have some standardised interfaces being supported into being by you :seedling:
Thanks for the kind words and the quick review :heart: please ping me if this causes any trouble, I've been using it as my daily driver but I know I can't always catch all the edge-cases.
This uses the ssb-uri module in both the search box and the link handler to support the use of
ssb:
URIs. This does not change the title of the tab, the sigil link presented in the search box, or any other details of how sigil links are handled.Oh, and this also switches us from the legacy URL parser (
require('url')
) to the "new" WHATWG API, which ships with JavaScript. More details here. I don't think that this has any downsides.Check out <ssb:message:sha256:BRf34OH0jSTOZ6g5x6OdvodI0etfbs08mvaIYy2Sae4=> to test.