Added Skychat support, async for redirect callback #1066
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there! The Bluesky function only supporting the Skyview system made it annoying to browse user pages. So I added Skychat, another project by the same developer.
In order to do so, the rewrite may need to perform a lookup on the DID, starting with DNS and then falling back to the .wellknown/atproto-did format, before failing to the handle. Maybe better to return 'false' instead?
Presently this DNS lookup is being handled by Cloudflare DoH, but can be replaced with anything else. JS doesn't natively support this or it'd be a non-issue. I'm very open to making changes, I just did not have any privacy options for DoH handy quickly.
But as a result, I had to convert the browser.webRequest.onBeforeRequest function callback into an async one, so that fetch could be awaited properly for a response.
Everything else seems fine afterwards as well.