Ease getting to an Ask user's profile

Here’s a script to put in your script executor browser extension, e.g. I use Code Injector on the URL pattern ask\.replit\.com/.*?(?!\.json)

function
c(){if(location.pathname.startsWith("/t/"))document.querySelector(".post-stream").ondblclick=({target:{dataset:{userCard}}})=>{if(userCard){open(`https://replit.com/@${userCard}#22-tab-0`,"_blank")}}
else
new
MutationObserver(c).observe(window["main-outlet"],{childList:true})}
c()
if(location.pathname.startsWith("/t/"))new
MutationObserver(c).observe(ember29,{childList:true})

And, on a topic, double-click a user’s username to get to their replit profile.
If you install the site as an app, at least on Edge, it means that the link opens in the sidebar.
It’d be cool if something like this could be hardcoded into Ask, maybe implemented in a less hacky way
nice code style right :upside_down_face:

6 Likes

Can this be used for anything else

yeah, you can change the link it goes to over here

1 Like

Oh yeah, and what code is this in again?

not sure what you mean by “code”. It uses JavaScript, the base scripting language for the web. Tap the ⌄ symbol in my post to collapse the quote and see where in the code the URL is (you probably have to scroll to the right in the code block to see)