Dark Mode

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

Sign up
Appearance settings

Commit d570867

Browse files
andauthored
Add URL query string handling to bluesky-thread.html (#114)
- When form is submitted, update page URL to include ?url=... parameter - On page load, check for ?url= query parameter and auto-populate/submit form - Enables sharing direct links to specific Bluesky threads Co-authored-by: Claude
1 parent 3f09499 commit d570867

File tree

1 file changed

+12
-0
lines changed
  • bluesky-thread.html

1 file changed

+12
-0
lines changed

bluesky-thread.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@

Bluesky Thread Viewer

192192
container.innerHTML = '';
193193
copyContainer.style.display = 'none';
194194
lastThread = null;
195+
// Update URL with the submitted post URL
196+
const newUrl = new URL(window.location);
197+
newUrl.searchParams.set('url', postUrl.value.trim());
198+
history.replaceState(null, '', newUrl);
195199
try {
196200
const url = new URL(postUrl.value.trim());
197201
if (url.hostname !== 'bsky.app') throw new Error('URL must be from bsky.app');
@@ -247,6 +251,14 @@

Bluesky Thread Viewer

247251
container.textContent = 'Error: ' + err.message;
248252
}
249253
});
254+
255+
// Check for ?url= query parameter on page load
256+
const params = new URLSearchParams(window.location.search);
257+
const urlParam = params.get('url');
258+
if (urlParam) {
259+
postUrl.value = urlParam;
260+
form.requestSubmit();
261+
}
250262
})();
251263
script>
252264
body>

0 commit comments

Comments
(0)