···991010## [Unreleased]
11111212+### Added
1313+1414+- Support for alternative HTTPS method for detecting DID
1515+1216## [1.2.0] - 2023-05-03
13171418### Added
+2-1
README.md
···991010
11111212-SkyLink works by detecting Decentralized Identifiers (DIDs) in a domain's TXT records and linking to the associated Bluesky profile.
1212+SkyLink works by detecting Decentralized Identifiers (DIDs) in a domain's TXT records as well as checking via the [alternative HTTPS method](https://psky.app/profile/emily.bsky.team/post/3juuaipn3q424) linking to the associated Bluesky profile.
13131414When a profile is detected, the icon lights up blue and clicking it will take you to their profile.
1515···2222**Contributors:**
23232424[@danielhuckmann.com](https://staging.bsky.app/profile/danielhuckmann.com) - Firefox Support & Privacy Consent
2525+[@aliceisjustplaying](https://staging.bsky.app/profile/alice.bsky.sh) - HTTPS Method of DID Detection
+21-5
content.js
···1111}
12121313// Function to check for a DID in the domain's TXT records
1414-async function checkForDID(domain) {
1414+async function checkForDIDDNS(domain) {
1515 // We use Google's DNS over HTTPS API to resolve the TXT record
1616 const response = await fetch(
1717 `https://dns.google/resolve?name=_atproto.${domain}&type=TXT`
···3030 return didRecord ? didRecord.data.replace("did=", "") : null
3131}
32323333+// Function to check for a DID in the well-known (not .well-known) location
3434+async function checkForDIDHTTPS(domain) {
3535+ try {
3636+ const response = await fetch(
3737+ `https://${domain}/xrpc/com.atproto.identity.resolveHandle`
3838+ )
3939+ const data = await response.json()
4040+ return data.did
4141+ } catch (error) {
4242+ return null
4343+ }
4444+}
4545+3346// Main function to perform actions, but only if the privacy consent has been accepted
3447function performAction(privacyConsentAccepted) {
3548 // If the user has accepted the privacy consent
···3750 // We check for a DID on the current domain
3851 ;(async function () {
3952 const domain = getDomainName()
4040- const did = await checkForDID(domain)
5353+ const domainDID = await checkForDIDDNS(domain)
5454+ const httpsDID = await checkForDIDHTTPS(domain)
41554242- if (did) {
4343- runtime.sendMessage({ type: "DID_FOUND", did })
5656+ if (domainDID) {
5757+ runtime.sendMessage({ type: "DID_FOUND", did: domainDID })
5858+ } else if (httpsDID) {
5959+ runtime.sendMessage({ type: "DID_FOUND", did: httpsDID })
4460 } else {
4561 runtime.sendMessage({ type: "DID_NOT_FOUND" })
4662 }
···4965 // We listen for messages from the background script
5066 runtime.onMessage.addListener((message, sender, sendResponse) => {
5167 if (message.type === "GET_DID") {
5252- checkForDID(getDomainName())
6868+ checkForDIDDNS(getDomainName())
5369 .then((did) => sendResponse({ did }))
5470 .catch(() => sendResponse({ did: null }))
5571 return true // Indicate that the response will be sent asynchronously.