Scroll to Text Bookmarklet (Link to Text Fragment)

  • Thread starter Thread starter Sushubh
  • Start date Start date
  • Replies Replies 9
  • Views Views 1,085

Sushubh

Admin
Staff member
Messages
408,373
Location
Gurgaon
ISP
Excitel
Airtel
Last edited:
JavaScript:
javascript:(function()%7Bconst selectedText %3D getSelection().toString()%3Bconst newUrl %3D new URL(location)%3BnewUrl.hash %3D %60%3A~%3Atext%3D%24%7BencodeURIComponent(selectedText)%7D%60%3Bnavigator.clipboard.writeText(newUrl)%7D)()

boomarklet code to copy url! works well on chrome 81.
 
Maybe it's time to stop using Chrome.
I've been using Chrome since launch and got so used to it so that I can't switch to any other browser.
I should have switched when they brought amp on mobile, but this is pretty bad.
 
Link to text fails when text is hidden under a drop down
 



Source


this is good. it was annoying that these links did not work on twitter somehow. i imagine same with reddit. reddit is still broken though.
 
looks like it is going to become a native feature in chrome.

chrome://flags/#copy-link-to-text