Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- localStorage.setItem('visited-'+window.location.pathname,true);
- var links = document.getElementsByTagName('a');
- for (i=0;i<links.length;i++) {
- var link = links[i];
- if (link.host == window.location.host && localStorage.getItem('visited-' + link.pathname + '/')) {
- link.dataset.visited = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement