Giter VIP home page Giter VIP logo

search-bookmarks-history-and-tabs's Introduction

Search Bookmarks, History and Browser Tabs

🔎 Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.

Installation via Store

Features

This extension does not collect any data nor does it make any external requests (see Privacy).

It supports two different search approaches:

  • Exact search (case-insensitive, but exact matching): Faster, but only exact matching results.
  • Fuzzy search (approximate matching): Slower, but includes also inexact (fuzzy) matches.

With this extension you can also tag your bookmarks including auto completions. The tags are considered when searching and can be used for navigation.

The extension is very customizable (see user options) and has a dark / light theme that is selected based on your system settings (see prefers-color-scheme).

For a list of recent changes, see CHANGELOG.md.

Screenshots & Demo

Demo Animation

User Documentation

  • Search Strategies: Switch between precise and fuzzy approach by clicking on the FUZZY or PRECISE button in the search bar (top right).
  • Keyboard Shortcut: Trigger the extension via keyboard.
    • The default is CTRL + Shift + ., but you can customize this (I personally use Ctrl+J).
  • Open selected results: By default, the extension will open the selected result in a new active tab, or switch to an existing tab with the target url.
    • Hold Shift or Alt to open the result in the current tab
    • Hold Ctrl to open the result without closing the popup.
  • Search Modes: In case you want to be more selective -> use a search mode:
    • Start your query with #: only bookmarks with the tag will be returned (exact "starts with" search)
      • Supports AND search, e.g. search for #github #pr to only get results which have both tags
    • Start your query with ~: only bookmarks within the folder will be returned (exact "starts with" search)
      • Supports AND search, e.g. search for ~Sites ~Blogs to only get results which have both tags
    • Start your query with t (including space): only tabs will be searched.
    • Start your query with b (including space): only bookmarks will be searched.
    • Start your query with h (including space): only history will be searched.
    • Start your query with s (including space): only search engines will be proposed.
    • Custom Aliases:
      • The option customSearchEngines allows you to define your own search mode aliases
      • Default: Start your query with g (including space): Do a Google search.
      • Default: Start your query with d (including space): Do a dict.cc search.
  • Emacs / Vim Navigation:
    • Ctrl+N and Ctrl+J to navigate search results up
    • Ctrl+P and Ctrl+K to navigate search results down
  • Special Browser Pages: You can add special browser pages to your bookmarks, like chrome://downloads.
  • Custom Scores: Add custom bonus scores by putting +<whole number> to your bookmark title (before tags)
    • Examples: Bookmark Title +20 or Another Bookmark +10 #tag1 #tag2
  • This extension works best if you avoid:
    • using # in bookmark titles that do not indicate a tag.
    • using ~ in bookmark folder names.

User Configuration

The extension is highly customizable. Finding and setting options is a bit technical, though.

The user options are written in YAML or JSON notation.

For now, there is no nice options overview, so you have to find them in the popup/js/model/options.js file in the defaultOptions object. From there you can see the available options, their names, default values and descriptions.

When defining your custom config, you only need to define the options that you want to overwrite from the defaults.

⚠ The options are not validated properly. Please make sure to use them correctly.
If something breaks, consider resetting your options.

An exemplary user config can look like the following example:

searchStrategy: fuzzy
displayVisitCounter: true
displayDateAdded: true

If you have troubles with performance, here are a few options that might help. Feel free to pick & choose and tune the values to your situation:

searchStrategy: precise
searchMinMatchCharLength: 2
displaySearchMatchHighlight: false,
searchMaxResults: 20
historyMaxItems: 200

Precise search is faster than fuzzy search. Start searching only when at least 2 characters are entered Highlighting search matches takes some effort, this can be disabled. Number of search results can be further limited Number of browser history items can be further reduced

Or a more advanced example:

searchStrategy: precise
historyDaysAgo: 14
historyMaxItems: 1200
historyIgnoreList:
  - http://localhost
  - http://127.0.0.1
colorStripeWidth: 4 # Customize width of search result color stripe
bookmarkColor: '#46e6e6' # customize color for bookmark results
scoreTabBaseScore: 70 # customize base score for open tabs
searchEngineChoices:
  - name: Google
    urlPrefix: https://google.com/search?q=
customSearchEngines:
  - alias: ['g', 'google']
    name: Google
    urlPrefix: https://www.google.com/search?q=$s
    blank: https://www.google.com
  - alias: d
    name: dict.cc
    urlPrefix: https://www.dict.cc/?s=$s
  - alias: [gh, github]
    name: GitHub
    urlPrefix: https://github.com/search?q=$s
    blank: https://github.com
  - alias: npm
    name: NPM
    urlPrefix: https://www.npmjs.com/search?q=$s
    blank: https://www.npmjs.com

In case of making multilingual searching (CJK) correctly, you may need to tweak uFuzzy options via option ufuzzyOptions, for example:

# make CJK chars work for fuzzy search
uFuzzyOptions:
  interSplit: (p{Unified_Ideograph=yes})+

Scoring System

The scoring systems works roughly the following:

  • Depending on the type of result (bookmark, tab, history) a different base score is taken (e.g. scoreBookmarkBaseScore).
  • Depending on in which result field (title, url, tag, folder) the match was found, the search match gets weighted by multiplication. (e.g. scoreTitleWeight).
  • This base score is now merged / multiplied with the search library score. A less good match will usually reduce the score and a perfect / highest ranked match will keep it at .
  • Depending on certain conditions some bonus score points are added on top. For example, exactStartsWithBonus will add score if either the title or the url start exactly with the search term, including spaces.

For a description of the scoring options and what they do, please see popup/js/model/options.js.

Privacy / Data Protection

This extension is built to respect your privacy:

  • It does not have permissions for outside communication, so none of your data is shared or exposed externally.
  • The extension does not even store any information except your user settings. Every time the extension popup is closed, it "forgets" everything and starts from a blank slate next time you open it.
  • There is no background job / processing. If the popup is not explicitly opened by the user, the extension is not executed.
  • The extension only requests the following permissions for the given reasons:
    • bookmarks: Necessary to read and edit the bookmarks. Can be disabled via user configuration.
    • history: Necessary to read the browsing history. Can be disabled or limited via user configuration.
    • tabs: Necessary to find open tabs and to use tabs for navigation. Can be disabled via user configuration.
    • storage: Necessary to store and retrieve the user configuration. If the browser has setting synchronization enabled, the extension settings will be synced (in this case you already trust your browser to sync everything else anyway). If browser sync is disabled, the user configuration is only stored locally.
  • The extension is open source, so feel free to convince yourself :)

Local Development

Install and Build

Prerequisite: Node.js

# install dependencies
npm install

# build extension
npm run build

The source code for the extension can be found in popup/ (HTML, JS and libs) and sass/ (SCSS/CSS).

The built extensions can be found

Developer Installation

  • Check out this extension via git
  • Run npm install and npm run build (via bash / git bash)
  • For Chrome / Edge:
    • Navigate to extensions page (chrome://extensions/ on Chrome and edge://extensions/ on Edge).
    • Enable "Developer mode"
    • Choose "Load unpacked" and open the root folder of this repository
  • For Firefox:
    • First install and build this project.
    • Load the built extension in dist/firefox as a temporary addon in about:debugging.

Developer Workflow

  • Typical developer actions
    • npm run build for a complete build
    • npm run start to start the extension locally in a browser (with mock data)
    • npm run test to run end to end tests
    • for more, see npm run

Credits

This extension makes use of the following helpful open-source projects (thanks!):

Feedback and Ideas

Please create a GitHub issue to give your feedback. All ideas, suggestions or bug reports are welcome.

search-bookmarks-history-and-tabs's People

Contributors

c0001 avatar dependabot[bot] avatar fannon avatar matdurand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

search-bookmarks-history-and-tabs's Issues

Create inline tipps in popup?

Some functionality of the popup is a bit hidden by using prefixes or specific options.
Maybe adding a "tipps" / "usage" in addition to the GitHub help link would be helpful?

ColorStripe and BookmarkColor

I've been udpated to v1.8.5.

I have thought the ColorStripe and BookmarkColor (I mean BookmarkFOLDER color) will keep the same color, but it only changes the stripe color.

image

image

Could you please offer options to set following colors seperately, too?

  • Bookmark Folder Color
  • Highlight SearchWords Color

Thank you so much!

How can I change the keyboard shortcut?

Hey, thanks, this is really good.

I'm on a Mac and was trying Shift + Control + . but nothing is triggered. How can I change the shortcut, looked at the documentation but could not find a reference for this settings. Thanks!

Nevermind, the issue was that on the Mac it's triggered by Command + Shift + Period which was already in use by 1Password, I change the 1Password shorcut and now your shortcut works - sweet!

Give project a searchable name

It's very hard to find the extension via search engines or in the extension stores. Have you thought about giving it a unique name which can be searched for?

Indicator color & Popup window width

  1. I don't have any clue where to change the colors & thickness of indicators, can we change this?

image

  1. Is it possible to show full url when mouse over the result? Otherwise, is it possible to change width of the popup window?

image

Thank you so much for the great extension!

Idea: Combine precise and fuzzy search

Overall, the precise search is better supported and works better than the fuzzy search.

-> PR #35

If the fuzzy search is combined with the precise search and only adds fuzzy results additinally, we could combine the benefits from both search approaches. Unfortunately, it would also combine the indexing times and search performance of both approaches.

This could be a third mode combined or the existing fuzzy mode is just enhanced.

Deps updates since commit 86ee9c6 cause CJK characters *fuzzy* search throw error message of "undefined"

Hi maintainer:

For recent 1.8.5 release checking out on my usage side, all of fuzzy search method (i.e. any search mode unless precise) thru CJK (i.e. chinese, japan and korean) prefix gives me an error message of:

Error Message:  undefined

without any candidates listed anymore.

I've spent some time to investigate the problem by checking out recently git commits for locating the final no-problem commit, it is 98ee21e. And I've compared the latest commit upates content again with that no-problem commit to found that the only break changes between is the deps updates via commit 86ee9c6.

In my test, when I revert the deps updates via commit 86ee9c6 based on latest commit (i.e. the main branch), the problem is gone.

I've not test which dep's updating caused this issue, hope for founding and helping me how to fix this problem.

Thanks.

I like it

I really like your plugin, it's exactly what I've been looking for to replace a feature in the Sidekick browser. However, I hope that your plugin can have a clearer and more user-friendly interface like theirs. Right now, it's difficult for me to distinguish between bookmarks and browsing history.
image

Arc (chromium) Browser: Cannot open "Options" or "Tips" pages

This looks to be similar to issue #39 , but in a different browser. I'm using Arc Browser 1.33.0 on MacOS 14.4
2024-03-16_12-48-35

The rest of the extension works fine, and I know at some point in the past, the "Options" page opened properly, even in Arc.

Recently though, when clicking Options or Tips from the footer, the click appears to be ignored in all contexts.

In normal Chrome v119.0.6045.199 on the same machine, the extension works exactly as expected without any issues.


Trying to follow the advise in the other issue, I cloned this repo, npm install and npm run build, and then "Load unpacked" the extension directly in to Arc, but I still don't know how to get to any console output specific to the extension (v1.9.5).
2024-03-16_12-53-05

If you can advise me on how to collect logs or console output for you, I'm happy to do so.


Other minor differences from #39 :

the popup freezes in the sense that I can no longer click any of the other links

This is not my experience.

found a workaround by opening and closing the extension window twice, which then allowed options tab to display.

This also, is not my experience. I cannot get the Options page to display in Arc in any scenario.

Make adjusting options more user friendly

The current way how to adjust the options is not very user friendly.

Building a UI around them is something I'd like to avoid since there are a lot of options and I would like to keep this simple.

Ideas

  • Simplify the options structure to be flat (currently there are nested objects)
  • Automatically migrate from old options structure to new structure, so the users do not have to adjust it manually
  • Document the options in Markdown (as a table?) instead of comments in the original code.

Feature Request: Display recent tabs when no search input is given

I use ctrl+tab in Firefox a lot to switch between my recent tabs. Unfortunately Firefox only displays the last 6 tabs. I'd like to have a feature to display the recently used tabs in the list when no search input is given.
What do you think of the idea? I can try to implement this and submit a PR, I'm a JS n00b, though, so I'd need some time to get comfortable with the code base.

Feature request: search bookmark folder to bookmark current tab in it or create new folder in this returned folder to bookmark current tab inside it

Hi,
Thanks very much for your add-on, clearly on the top list of my favourite ones.
Searching is perfect with this addon, what would be great would be to improve storing bookmarks with the same powerful search tool.
In the bookmark folder tree, it can be quite long to choose the right folder, opening each folder one after the other to get to the final leaf folder. It would be great to be able to make a bookmark folder search ( maybe f keyword ), and then just save current tab in it or create new bookmark folder in that folder and be able to finally save current tab in that newly created bookmark folder.
You made a great job !!

idea: trigger search engine by prefix

Hi,

One of the best extension so far I use in Firefox.

There is a feature in the command palette from Vivaldi that would be nice to add in your extension.

It would need to add a property for search engine such as

  - name: Google
    urlPrefix: https://www.google.com/search?q=
    alias: g

When you want to run a search for a term in google you would type g this my search in google and press enter. The search is run in a new tab. Prefix should be detected as soon as you follow them by a space. Then the first result in the list would the name of the search engine stating that the following term will be searched with it. The next items in the list would still be the usual search results from the whole input.

An alias can be one letter to a much long word.

I’ve used this workflow for years and I assure this fast and effective.

Remove "hybrid" search

With the change to use uFuzzy as fuzzy search it behaves much more close to precise search anyway.

I'm not sure whether keeping the hybrid search is worth it. I'll likely remove it, except anyone has objections and uses it with great benefit.

[Firefox] Can’t open privileged URLs like about:config

Firefox OS Extension
102.0 Win 10 x64 pro (french) 1.5.0

I only tested in Firefox. It might be the same in Chrome.

Edit : extensions are limited by Firefox, so they can not open some privileged URLs, like those starting with "about:" or "file:" ("about:blank" are allowed). So there is nothing you can do unfortunately.

"Options" and "Tips" broken

When opening your addon and clicking on the "Options" or "Tips" link in the popup's footer, then nothing happens. Also, the popup freezes in the sense that I can no longer click any of the other links, though it still can be closed by clicking outside.

I'm using version 1.5 of your addon on Firefox 98.0b5, that is the Firefox Developer Edition.

Add website icons?

Hey thanks for the extension, looking really good!

I feel like adding the site icon (maybe as an option) would help a lot to see at a glance the source of a search result.
Basically, I consider more relevant a reddit icon at the left than the whole reddit url (I would keep it to see the matching substring etc).

Is it for a technical reason? I just like bookmarks with icons :)

Another comment (I didnt want to open multiple issues, but feel free to do so). Could the wheel click open tabs in the background directly without having to ctrl+click? It would be consistent with the rest of chrome.

Cheers

Getting errors

Hi there,

Your extension looks great, and I am looking forward to using it, however, I'm seeing an error.

When I bring up the search window and start to type something, I get the following error messages (with search mode on 'Precise'):

Error Message: searchPerformance[0] is undefined
Error Stack: searchWithAlgorithm@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/search/common.js:202:1 search@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/search/common.js:110:41
Error: Could not initialize Extension
Error Message: totalInitPerformance[0] is undefined
Error Stack: initExtension@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/initSearch.js:74:3

And with search mode set to 'Hybrid', I get:

Error Message: searchPerformance[0] is undefined
Error Stack: searchWithAlgorithm@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/search/common.js:202:1 search@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/search/common.js:115:38
Error: Could not initialize Extension
Error Message: totalInitPerformance[0] is undefined
Error Stack: initExtension@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/initSearch.js:74:3

And with search mode set to 'Fuzzy', I get:

Error Message: searchPerformance[0] is undefined
Error Stack: searchWithAlgorithm@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/search/common.js:202:1
Error: Could not initialize Extension
Error Message: totalInitPerformance[0] is undefined
Error Stack: initExtension@moz-extension://16cfb718-d236-4597-befb-3c9f7b2ffdf6/popup/js/initSearch.js:74:3

That's with typing one character in the search box. If I type more characters I get more of those same errors repeated.

No actual search results appear.

I am using LibreWolf (v109.0.1, which is a Firefox-based browser), along with the uBlock Origin extension enabled (and also the 'Tab Stash' extension), so maybe that has something to do with it? Or perhaps I've changed some other setting in the browser and I've messed something up?

Anyway, just curious if there's something I can change or adjust to get your extension working.
Thanks.

Fuzzy Search Issues

imo the current fuzzy search is useless because it seems (in my experience) to be so 'fuzzy' as to search for individual LETTERS.

imo, a useful proper 'fuzzy' search for match for each of the individual words: not the whole string. the issue here would be to be an OR or an AND match. i could see that BOTH would be useful.

my advice is to have comma delimiters if you want an OR search of each word, and + delimiters if you want an AND search for each word (but individually), and no separators if you want to match the whole string. that works logically with those delimiters.

Keep last search result selected

Hello!

It seems every extension will empty the search result after closing the popup windows. I have a suggestion as in bellow image. I wonder if we can get such a function. Thanks!

image

How to search inside a specific bookmark folder

As the title says, how can we search only inside a specific bookmark folder?

Also, typing inside the search box is quite slow. It appears as if the browser hangs every time I start typing inside the search box.

multiple languages support?

I think it is a very useful add-on. However, This add-on seems to be limited to single-byte characters.

  1. Is it possible to support multiple languages?
    image

  2. It would be useful to be able to open a new page without closing the search results with a middle click.
    Thanks!

Search Through Older History

This extension can currently only search the browser's saved history. Once we clear the history, it will no longer be searchable. Have you considered enabling the extension to search through past browsing history, similar to the Falcon extension? However, it would not be necessary to index the entire text, only the web page titles, and it would be limited to a certain time frame, such as history from the past 30 days, 60 days, 90 days, 365 days, etc. It would also automatically delete history records from before this time period.

Thank you!

Open URL in current tab is not working

Hi,

I have been looking for an extension that let me search in bookmarks and tabs, and yours is the perfect extension 👌🏽, thanks a lot.

I noticed that, If I have more than 1 window open, the current tab (in my active window where the extension was activated) is not changing if I press Shift + Enter. Instead, the active tab from the other window (maybe some window in the background) is changed.

I think maybe adding the option currentWindow: true to query tabs in file searchView.js make the trick.

Regards.

Limit (vertical) size of link title

If a link title is not given correctly, it could be that a complete URL with long size is shown as title. That can take up almost all of the popup size for one link alone. Better would be to set a max height for the title. I think the URL length is already limited and uses ellipsis.

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.