Code Monkey home page Code Monkey logo

deep-search's People

Contributors

henrymarshall avatar labrats5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deep-search's Issues

Use constants for actions a la Redux

By convention action types are specified as constants in Redux. This causes them to throw errors in the event of a typo rather than failing silently.

I don't think chrome.tabs.sendMessage would throw if message is undefined, but adding a

case undefined: throw new Error("Undefined request.message, possible typo")

to the various messageListener.js or messageContent.js would be simple in any case.

Matches/Clear should be in memory rather than in DOM

Depending on the page and your search, clearMarks can involve hundreds or thousands of DOM changes. Performance improvements may be achievable by using jQuery's clone, modifying that, and replacing the page's contents.

If this results in marked improvements consider a similar procedure in content/shallow/search.js.

Provide deep-search results in tooltip

As of now, after a successful deep-search, results are presented in a simple alert. It would be nicer if the match results were presented in an html table. This would permit copying to the clipboard. It would also look a good sight better!

After discussion at LIJS, it was decided that a tooltip would be a better form factor than a modal as it is easier to dismiss (move mouse away) and will never directly cover the link itself in the likely event you do want to visit it.

There are lots of tooltip libraries out there and something may fit our bill. However we do have some peculiar concerns:

  • Intelligently position the (potentially large) tooltip to maximize space and readability
  • Permit the user to mouse into the tooltip and interact with it
  • Contain an HTML table
  • Contain buttons
  • Scroll in both x and y directions in the (not unlikely) event of an overflow
  • Use custom namespaced CSS (as I understand it, we'll be injecting our CSS into the page -- we can't risk clobbering someone's Bootstrap 2 rules by using Bootstrap 3 as a dependency)
  • Be opened programmatically (i.e., with hotkeys)

Stopping an unfinished search results in pending downloads being completed

Steps to Reproduce

  1. Go to a page with a bunch of links (human reaction time plays a part)
  2. Perform a deep search for anything
  3. Hit the clear button before the results finish coming in

Observed Result

Pages that were in the process of being downloaded when the clear command was issued appear with their appropriate marks.

Expected Result

No marks should be on the page

Memory leak in deep search

When performing a deep search the $.ajax requests are leaking a small amount on memory. Because this is a long running extension, this can eventually add up if the user does not close their browser with any frequency.

Experiments using the Google Closure library's XHR pool appear promising.

Extension violates Chrome Web Store policy

It looks like this extension has disappeared from the Chrome Web Store. Additionally, the extension settings show a warning:

โš ๏ธ This extension violates the Chrome Web Store policy.

No more information is provided. I'm wondering whether this is an easily fixable situation, or whether it requires changes to the extension itself?

I can still use the extension for now, but updating or installing it to another computer might get tricky.

I'm using Chrome 112.0.5615.137 on MacOS 13.3.1, and Deep search v0.1.2

Default to Regex mode?

Hey Henry,

Thanks for making this extension! ๐Ÿ‘ I know you're probably not thinking of updating it much these days but I wanted to make one small request?

I use this exclusively for Regex searches, and it's a pain that the state of that button isn't preserved between tabs/sessions. I got tired of clicking it and made it default to "on" by hand-editing popup.js (was a bit tedious to find since the code was minified but I did find that changing isRegex:!1 to isRegex:!0 did the trick).

Is it possible to change the below to default to isRegex: true, ?

Even better would be an "options" page that allowed the user to choose their preferred defaults. I realize that's a bit more work. Either way, thanks for reading!

Searching through XML files has issues

Hi,
I wanted to use the extension to search and extract info from XML files that I have available online for browser access. But the highlighting is not working and for me even worse the download as CSV does not work.

For the download as CSV I see the below error in Chrome console:
Error in event handler: TypeError: n.click is not a function
at n (chrome-extension://jlkomfekppedfijpagfiapmghpoaegpc/scripts/contentscript.js:34:255)
at Object.o [as downloadCsv] (chrome-extension://jlkomfekppedfijpagfiapmghpoaegpc/scripts/contentscript.js:43:8368)
at chrome-extension://jlkomfekppedfijpagfiapmghpoaegpc/scripts/contentscript.js:26:7917

I am using Chrome Version 92.0.4515.107 (at the moment) on Windows 10 and installed the deep-search extension today (0.1.2).

One example of a XML content would be:

service-configuration>
<!--  time interval (seconds) between fetching data from the server - for all viewers  -->
<refresh-interval-secs>60</refresh-interval-secs>
<auto-scroll-delay-secs>90</auto-scroll-delay-secs>
<product-services>
<!--  #### Viewers ####  -->
<service name="Products">
<service name="OPE">
<service name="MRT">
...

Would be great if you could have a look at what could be the problem. If you need any further info from me, let me know.

Best regards,
Manfred

State not maintained on per tab basis.

Steps to reproduce

  1. Perform a shallow search on page 1 for "foo" (where "foo" has several matches)
  2. Go to page 2 and search "bar".
  3. Go back to page 1
  4. Open deep search popup

Observed: Search box has "bar", but "foo" elements are still highlighted. Clicking "find" or "find prev" cycles through instances of "foo".
Expected: Search box retains query on a per tab basis. Returning to tab 1 causes the text to revert to "foo". Options "case insensitive", "use regex" should also be separately maintained.

Thoughts

Per tab state seems like it would be a common problem, investigate whether there is a Right Way.

State is currently stored on a background page as a single global. It could be stored as an object with tab IDs for keys. This strategy would prevent automatic garbage collection if relevant key:value pairs are not deleted when tabs are closed. This seems like an easy thing to get wrong (crashed tabs, closed windows etc), but is the right place to maintain store.

A somewhat jankier solution is to store the state as a global on the page in question. GC would happen automatically when the tab disappears. A side benefit of divorcing state management from the background is that the remaining processes (cross origin downloading of linked pages and search matching) could be made into event pages with resultant performance gains.

Changing your search should't scroll to the first result

Steps to reproduce

  1. Perform a shallow search for something with multiple results on the page
  2. Click "Find" until the page scrolls in order to display it
  3. Delete the last character of your search (thus recalculating all matches)

Expected result

A substring of the string that was selected after step 2 should now be selected. This is how the baked-in chrome search functions

Observed result

The first match for the new string will be matched. This will scroll your viewport to see it.

Notes

Currently the deepSearch-current-highlight class is assigned as part of the call to findAndReplaceDomElements. Because resolving #5 makes it impossible to know what will be in the viewport during this replacement, identification of the current highlight must be deferred.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.