Vis4Sense / HistoryMap

http://sensemap.io
60 stars 7 forks source link

Detect ULR change type: typed, link clicked, or others. #76

Closed kaidatavis closed 5 months ago

kaidatavis commented 7 years ago

Currently SenseMap is not aware how the URL is changed. There are a few possibilities:

  1. user manually typed a new url in the address bar
  2. user clicked a link,
  3. page redirection,
  4. ... It will be useful to know which of these happened for a url change, so SenseMap can respond accordingly.
kaidatavis commented 7 years ago

The latest commit (323a97c1b48622bfd983b5236176f9891a576a05) is still having errors. See the screenshot below screen shot 2017-06-19 at 10 00 33

phongvis commented 7 years ago

It was because tab.url is empty. I couldn't reproduce your search but if you click on the error figure that you uploaded here, it always causes the problem. I guess, in your case, the three first empty nodes are the ones without url. I just pushed the code to log that case. Maybe, no node should be created with empty url?

kaidatavis commented 7 years ago

Yes, I agree the error was caused by the empty nodes with no url. However, these empty nodes were not there before. I see you changed the code, but the empty nodes are still there. Also, the node for the temporary google search url before redirection disappeared (we need this for detecting redirection). If this is an issue requires more work, put the 'type' detection code in a branch and revert the 'rebuild' to before its introduction, so it won't affect other's testing.

phongvis commented 7 years ago

Not sure it's because of my code. I just test it myself by reverting the code to ee0375559a2ae84bc7a86fbf25622bec6e6b78b0 but the 'empty nodes' are still there. You can test it again by clicking on the picture in this issue page.

kaidatavis commented 7 years ago

I think I found the error, which is quite simple. See the latest commit. It was introduced in commit 3456c26fef792d6ddbb700f813329cf946adcb39, which is done by you though :-)

phongvis commented 7 years ago

ok, it was my carelessness and it makes sense because while you tested, the page titles might get updated later. But the other 'empty node' case when you click on the screenshot is still there. Did you try?

kaidatavis commented 7 years ago

Yes, it seems that there is a 'new tab' event without url when opening a link in a new tab. Can you add this to the 'ignored url' list or the condition in onTabCreation()? I tried but can't get it work.

phongvis commented 7 years ago

I think it doesn't always happen when opening a link in a new tab. I haven't found any other cases producing 'empty node' besides clicking on this github page's figure. 'ignored urls' are for pages that we don't want to capture provenance such as viewing source and extension page. Well, I think there's nothing wrong to even capture all these pages.

I think it was because of page redirection and we have 2 options:

kaidatavis commented 7 years ago

I will go for the first option

capture it as an empty url node (as it currently is) and ignore it when rendering

Is this something you need to change in the 'list-to-tree.js'?

phongvis commented 7 years ago

yes, and I just made that change as well

kaidatavis commented 7 years ago

nice work. I can see the change removes the node with no url or title, but the redirection node is still there. Is this correct?

kaidatavis commented 7 years ago

yes, and I just made that change as well

I reversed the changes you made in the list-to-tree.js, because in the latest 'browser-provenance.js', a node will be updated (rather than a new node being created) so long as it does not reach the 'complete' status. This addresses both 'empty url' new node problem and redirection.

phongvis commented 7 years ago

So, do we assume that redirection pages don't reach 'complete' phase? I just checked a google search, redirection pages still display.

kaidatavis commented 7 years ago

So, do we assume that redirection pages don't reach 'complete' phase?

Yes, from what I see the google search redirection always happens before the 'complete' status.

I just checked a google search, redirection pages still display.

Can you provide a bit more details? I just tried again and it seems to work fine. There are two google searches in the screen shot below and there is no redirection node

screen shot 2017-06-26 at 21 30 34