Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added Skychat support, async for redirect callback #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

KayOhtie
Copy link

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.

@ManeraKai
Copy link
Member

ManeraKai commented May 23, 2025

If I remember, you can't use async on browser.webRequest.onBeforeRequest in chromium, but can in firefox. However, you can make the HTTP request as sync. For example. In OSM redirections, we use a sync request to determine the address lat, lng:

function addressToLatLng(address) {
const http = new XMLHttpRequest()
http.open(
"GET",
`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(address)}&format=json&limit=1`,
false
)
http.send()
if (http.status == 200) {
const json = JSON.parse(http.responseText)[0]
if (json) {
return {
coordinate: `${json.lat},${json.lon}`,
boundingbox: `${json.boundingbox[2]},${json.boundingbox[1]},${json.boundingbox[3]},${json.boundingbox[0]}`,
}
}
return {}
}
}

@ManeraKai
Copy link
Member

I didn't notice, but this issue is related #1037

@KayOhtie
Copy link
Author

Will cancel for now, though Skychat does also allow browsing profiles without being logged in at all in the same way Nitter does, it just primarily appears as a client for login. I will remove for now and possibly just submit as a separate extension to preserve purpose of this one.

@KayOhtie KayOhtie closed this May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.