Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Mark Scroll Positions (rugu.dev)
35 points by kugurerdem 11 months ago | hide | past | favorite | 18 comments
Hi everyone,

I was getting annoyed when I had to leave a page and then needed to find where I was when I reopened it each time. So, I have just built a web extension to allow users to mark certain scroll positions for a page and then jump between them.

I hope it can be of use to you as well.




This is a good idea to a very niche but annoying problem I've certainly faced.

I've always used the "Copy link to text" option in Chrome for this but that doesn't always work when the formatting is a little complex.


"Copy link to highlight" is a great feature indeed. Pretty much an anchor-link-on-demand. I just wish it was fully supported across browsers.

Seems like Desktop Chrome/Edge support creating links to and showing highlighted text, Safari/Android Chrome supports showing highlighted text but not creating the links, and Firefox supports none of it.

I should make a bookmarklet/extension for this...


There's already a firefox extension [0] based on the exact code that google started with for chrome.

I remember being a little annoyed by those fake anchor links when they first appeared, but I've since softened to the concept.

0: https://addons.mozilla.org/en-US/firefox/addon/link-to-text-...



Vimium has this already built in.


How so ?

I am using vimium and I don't know what you are talking about I suppose it's like vim marks but couldn't find info about such a feature


Yeah, you can set a mark with ‘m’ and then go to it with the tilde key


Thanks !


Wow, I did not know this despite using it for a long time. It perfectly makes sense though. Thanks for letting us know :)


What happens if you resize your browser window?


From the code and a quick test it seems relatively resilient as it saves percentage of current viewport scroll, not absolute pixels.


As discussed in the essay there are still some potential issues with dynamic pages. [1] Horizontal resizes might change the location of certain HTML elements, if the website is designed to be "responsive". This is a problem that I still need to address. Another issue arises with pages that can be dynamically appended (e.g., through comments) towards the bottom. In this case, simply making a calculation based on the previous percentage where the user marked the page fails. This is yet another problem that I need to address.

However, the current jumping method seemed to be working fine for most of the sites I use, so I decided to release the app first and improve it along the way based on the traction it gets.

1. https://www.rugu.dev/en/blog/mark-scroll-positions/#3-decidi...


In that case, what happens when you resize your browser window to be shorter or taller?


You are on point, the extension starts to slightly malfunction if the user starts to resize the browser window vertically. This is because of the assumption that `(window.pageYOffset + window.innerHeight) / document.body.scrollHeight` will approximately equal 1 when the user has scrolled to the bottom of the page (which apparently, is not necessarily the case).

Will address this issue ASAP. [1]

Thanks for finding an edge case which I did not notice :)

1. https://github.com/kugurerdem/mark-scroll-positions/issues/1


Good question, considering that the width of the browser viewport often determines the vertical flow of the page.


Hey nice product.

At work so don’t have time to explore it right now but what features does it provide that Vimium marks don’t ?


Thanks!

I was not aware that Vimium could already do what I tried to accomplish but to give you an answer: I made it possible that marks can be properly re-named and have their note taking place. You also have a management page where you can see all the marks that you have set for all different sites. Other than these, nothing so fancy.

There is still lots of room for improvement to make the UI/UX better.


this is quite nice. are you considering making a bookmarklet version? I'm guessing most of the functionality comes from the content script, and background script stuff for handling extension/"button" click could probably be migrated to a sticky that lives as long as the session it was spawned in but I don't mean to minimize the trade offs involved ... again, this is very awesome




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: