E-H Visited

Upgrade to EhxVisited (sleazyfork.org/en/scripts/377945)

< Feedback on E-H Visited

Question/comment

§
Posted: 2019-04-12

Can you add a few lines?

Hey, me again. I noticed you changed your script to monitor mouse events and this kind of broke my script's compatibility with yours in a way that I can't fix from my end. I think it also would fix a potential bug with multiple pages being open.

Basically, you only call localstorage on page load, and when my script makes changes to the localstorage, your script can write over them with the old value. The fix would be to call localstorage each time before writing to it. If you add the line

vis = JSON.parse(localStorage.getItem(storageName));

before each line vis.data[c] = Date.now();

which is 3 times in the current script, it would fix it.

This would also fix instances where you have two pages open and clicking on links from both: right now, each page would overwrite using an outdated copy of localstorage from when it was opened. I think in general, calling the localstorage afresh each time before you write to it is a good idea.

HEN-TIEAuthor
§
Posted: 2019-04-14
Edited: 2019-04-14

Sounds smart, I'll try it out tonight!

I have seen that overwriting thing happen, but only when opening links inhumanly fast using browser extensions. Hopefully this helps!

Post reply

Sign in to post a reply.