n8chz / prostetnic

The prostetnic highlighter, a Firefox add-on for highlighting text in web pages.
8 stars 3 forks source link

Non-unique matches #4

Open diligentmicrobe opened 9 years ago

diligentmicrobe commented 9 years ago

I noticed that if there are duplicate instances of a saved highlight on a page prostetnic only highlights one of them randomly. Would it be possible to have it highlight all instances?

n8chz commented 9 years ago

That was something of a design dilemma. I could record (say) the string position within the page's textContent of the beginning of the selection, and then the question of which of several passages were highlighted would be unambiguous, IF the page content hasn't changed between sessions. That would necessitate changing the data schema, coming up with a policy for highlights logged with prior versions (even if it's the same policy, making it an exception to the position-aware scheme would be some amount of new code). Bottom line: matching text passages within a URL that is subject to editing and other revisions is a non-trivial problem with no non-ambiguous solution. I don't know whether I'll be addressing your specific concern at some point. If so, it will probably be in the context of a major rewrite.

On re-visit, the highlight is applied to the last matching passage. That was of course an arbitrary decision. The relevant code is in data/hilite.js, at like 53 I suppose highlighting all instances would involve replacing the rightmostMatch method with one that returns an array of all matches, and replacing the if structure that starts at line 59 with a .forEach call over the elements in the resulting array.

GitHubAndProstetnic commented 9 years ago

Hi Ms. Lee,

Thank you for this information. Your prostetnic software, if the flaws are removed, would be the best out there for communicating directly the statements of others, in particular those who depend on the short memory of most to extend their inaccuracies of the past into the future. If you were to decide to sell this software after removing the inadequacies I believe it would become a best seller.

Best to you on this holiday season,

Wally Diehl DIEHL ENGINEERING COMPANY

-----Original Message----- From: Lorraine Lee [mailto:notifications@github.com] Sent: Friday, December 19, 2014 4:06 AM To: n8chz/prostetnic Subject: Re: [prostetnic] Non-unique matches (#4)

That was something of a design dilemma. I could record (say) the string position within the page's textContent of the beginning of the selection, and then the question of which of several passages were highlighted would be unambiguous, IF the page content hasn't changed between sessions. That would necessitate changing the data schema, coming up with a policy for highlights logged with prior versions (even if it's the same policy, making it an exception to the position-aware scheme would be some amount of new code). Bottom line: matching text passages within a URL that is subject to editing and other revisions is a non-trivial problem with no non-ambiguous solution. I don't know whether I'll be addressing your specific concern at some point. If so, it will probably be in the context of a major rewrite.

Reply to this email directly or view it on GitHub https://github.com/n8chz/prostetnic/issues/4#issuecomment-67630671 . https://github.com/notifications/beacon/AHgCA141fcnh-Q49V8gDREe340967o9Pks5 nZAwbgaJpZM4DI1me.gif

GitHubAndProstetnic commented 9 years ago

Dear Ms. Lee,

I tried again using your highlighter on my User account (Windows 8.1). It works out of an Administrative account but not in my User account. I won't use it out of an Administrative account because of the risks of malware.

It seems this is the flaw that keeps this application from being usable, at least for me.

I did try contacting you through the link provided through the Add-On for Firefox.

Regards,

Wallace G. Diehl


From: Lorraine Lee [mailto:notifications@github.com] Sent: Friday, December 19, 2014 4:06 AM To: n8chz/prostetnic Subject: Re: [prostetnic] Non-unique matches (#4)

That was something of a design dilemma. I could record (say) the string position within the page's textContent of the beginning of the selection, and then the question of which of several passages were highlighted would be unambiguous, IF the page content hasn't changed between sessions. That would necessitate changing the data schema, coming up with a policy for highlights logged with prior versions (even if it's the same policy, making it an exception to the position-aware scheme would be some amount of new code). Bottom line: matching text passages within a URL that is subject to editing and other revisions is a non-trivial problem with no non-ambiguous solution. I don't know whether I'll be addressing your specific concern at some point. If so, it will probably be in the context of a major rewrite.

Reply to this email directly or view https://github.com/n8chz/prostetnic/issues/4#issuecomment-67630671 it on GitHub. https://github.com/notifications/beacon/AHgCA141fcnh-Q49V8gDREe340967o9Pks5 nZAwbgaJpZM4DI1me.gif

n8chz commented 9 years ago

I'm not sure how to address this issue as I don't have a Windows box and haven't tested it on Windows. The most relevant-seeming thing I have found so far from Dr. Google and suggests something might be up with something called "UAC:"

http://answers.microsoft.com/en-us/windows/forum/windows8_1-desktop/firefox-problems-for-all-secondary-users-in-win-81/233e43e1-183c-48a7-9ef6-3333e670afab

And of course the Microsoft people say go ask the Mozilla people. I'll try to install and use it next time I get to the library, but since the last Windows upgrade they did there, Firefox doesn't work at all, so I'm not holding my hopes too high.

GitHubAndProstetnic commented 9 years ago

Hi Ms. Lee,

Your app now works for me and I use Firefox. Maybe previously I overlooked display requirements (saturation & RGB) and just used the default.

Best regards,

Wallace G. Diehl

DIEHL ENGINEERING COMPANY


From: Lorraine Lee [mailto:notifications@github.com] Sent: Wednesday, January 21, 2015 1:32 PM To: n8chz/prostetnic Cc: GitHubAndProstetnic Subject: Re: [prostetnic] Non-unique matches (#4)

I'm not sure how to address this issue as I don't have a Windows box and haven't tested it on Windows. The most relevant-seeming thing I have found so far from Dr. Google and suggests something might be up with something called "UAC:"

http://answers.microsoft.com/en-us/windows/forum/windows8_1-desktop/firefox- problems-for-all-secondary-users-in-win-81/233e43e1-183c-48a7-9ef6-3333e670a fab

And of course the Microsoft people say go ask the Mozilla people. I'll try to install and use it next time I get to the library, but since the last Windows upgrade they did there, Firefox doesn't work at all, so I'm not holding my hopes too high.

Reply to this email directly or view https://github.com/n8chz/prostetnic/issues/4#issuecomment-70925886 it on GitHub. https://github.com/notifications/beacon/AHgCA4KdXjkCsNI_Mpu-DyCZp-HRoV1Iks5 nkBJMgaJpZM4DI1me.gif