HistoryMap icon indicating copy to clipboard operation
HistoryMap copied to clipboard

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

Open kaidatavis opened this issue 8 years ago • 14 comments

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 avatar Jun 19 '17 09:06 kaidatavis

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

kaidatavis avatar Jun 19 '17 09:06 kaidatavis

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?

phongvis avatar Jun 19 '17 13:06 phongvis

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.

kaidatavis avatar Jun 19 '17 14:06 kaidatavis

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.

phongvis avatar Jun 19 '17 15:06 phongvis

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 :-)

kaidatavis avatar Jun 19 '17 16:06 kaidatavis

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?

phongvis avatar Jun 19 '17 22:06 phongvis

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.

kaidatavis avatar Jun 19 '17 22:06 kaidatavis

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:

  • capture it as an empty url node (as it currently is) and ignore it when rendering
  • do not capture it at all Both cases, extra consideration is required to establish correct link as an intermediate node is removed.

phongvis avatar Jun 20 '17 13:06 phongvis

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'?

kaidatavis avatar Jun 21 '17 09:06 kaidatavis

yes, and I just made that change as well

phongvis avatar Jun 22 '17 14:06 phongvis

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 avatar Jun 22 '17 16:06 kaidatavis

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.

kaidatavis avatar Jun 23 '17 11:06 kaidatavis

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

phongvis avatar Jun 26 '17 14:06 phongvis

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

kaidatavis avatar Jun 26 '17 20:06 kaidatavis