Author Topic: need Bookmarklet: mark all links on page as visited  (Read 4537 times)

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
need Bookmarklet: mark all links on page as visited
« on: June 09, 2014, 04:18:50 PM »
There's a firefox ext and it's great, but I need multi-OS and multi-browser and the only thing that fits the bill is a bookmarklet.  I've deep-searched more than a few times for this and turned up nothing.  If you see one in your travels, let me know.

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #1 on: June 09, 2014, 07:07:46 PM »
do you want the links to:

a. visually appear visited
b. actually be visited by so the URLs shows up in your history
c. actually be visited by so the visits show up in log files
d. something else

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #2 on: June 09, 2014, 08:24:21 PM »
B.

Here's the FF extension, which worked perfectly for me. It is a little more feature-loaded than I need in a bookmarklet.  I rarely used the toggle individual link option.  In the bookmarklet-on-toolbar environment, I think a simple "mark all as visited" would suffice.

https://addons.mozilla.org/en-US/firefox/addon/link-visitor-3/

Quote
This add-on provides the ability to add single or multiple links to the browser history, making them appear visited, without having to actually visit them. It also allows them to be removed from the history.

For a single link, right click and select 'Toggle visited status'.
For older versions of Firefox , right click and select "Mark link as visited" or "Mark link as unvisited" (depending on current state).

For multiple links, The View and Context menus contain the menu entry to "Mark Links Un/Visited", which provides the ability to mark all links, or those within a selected region, as visited or unvisited.

Here's a Greasemonkey script I happened upon
https://greasyfork.org/scripts/552-link-visited/code

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #3 on: June 09, 2014, 08:28:47 PM »
<added>

Use scenario:  I read a lot of news aggregators that move the headline up/down on the page based on popularity.  I scan the page, read any I want to read, then mark all article links as visited.  When I return, any new articles in the list are easy to pick out.

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #4 on: June 09, 2014, 10:30:40 PM »
history.pushState ?

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #5 on: June 09, 2014, 10:38:36 PM »
I'm not knowledgeable enough to answer that, Jason.

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #6 on: June 09, 2014, 10:43:44 PM »
Sorry.

Are all the links you want to show as visited on the same domain as the page that you'll be on?

If so, history.pushState should/ will do it.

If the links point to pages on different domains then a different route will have to happen (I think it's still very doable, by EG opening each link in hidden iFrames on the page but pushstate is much cleaner)

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #7 on: June 09, 2014, 10:56:13 PM »
No, the bulk of the links are almost always on other domains.  A reddit page would be a good/easy example to cite

http://www.reddit.com/  


JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #8 on: June 09, 2014, 11:14:39 PM »
Code: [Select]
javascript:var array = [];var links = document.getElementsByTagName("a");for(var i=0; i<links.length; i++) {var iframe;iframe = document.createElement('iframe');iframe.src = links[i].href;iframe.style.display = 'none';document.body.appendChild(iframe);}



N.B. This is likely to hang your browser on pages with lots of links (if it works at all) but "should" / "might" do what you want.

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #9 on: June 10, 2014, 11:56:37 AM »
Couldn't get it to work (Win8.1 Chrome). I'll play with the code sometime. Thanks for trying.

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #10 on: June 10, 2014, 07:48:43 PM »
It's a known bug in Chrome and most (but not all) other Webkit browsers.

URLs opened in Iframes don't show in history as visited.

To make this work it will either need an extension / plugin to get past the same origin security policies or physically open then close once loaded, the URLs.

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #11 on: June 10, 2014, 09:03:13 PM »
>iframe

Would it work to throw it to a (named) new window?

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #12 on: June 11, 2014, 05:24:17 AM »
>iframe

Would it work to throw it to a (named) new window?

It should, yes :)

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7273
  • Debbie says...
    • View Profile
Re: need Bookmarklet: mark all links on page as visited
« Reply #13 on: June 11, 2014, 11:39:38 AM »
Thought it should.  It'd be a kludge, but worth it for my high-volume online reading habit.  I'll see what I can cobble together out of your js. Thanks!

JasonD

  • Inner Core
  • Hero Member
  • *
  • Posts: 1420
  • Look at THAT!!!!
    • AOL Instant Messenger - JasonDDuke
    • View Profile
    • Domain Names
    • Email
Re: need Bookmarklet: mark all links on page as visited
« Reply #14 on: June 15, 2014, 04:57:30 PM »
No probs. Hope it helps.