Coder Social home page Coder Social logo

fivefold / linkding-injector Goto Github PK

View Code? Open in Web Editor NEW
182.0 5.0 7.0 840 KB

Injects search results from the linkding bookmark service into search pages like google and duckduckgo

License: MIT License

PowerShell 0.32% Shell 0.34% HTML 0.32% JavaScript 10.53% SCSS 4.71% Svelte 7.18% CSS 76.61%
bookmarks chrome-extension firefox-addon linkding search webextension browser-extension firefox-extension

linkding-injector's Introduction

logo

Community browser extension for the self-hosted linkding bookmark service.

Ever created bookmarks, only to forget about them later? Don't regularly search within your bookmarks? This extension is designed to help with this kind of problem.

Features

  • When searching on a search engine the search term is also sent to your linkding instance and results are added in a new box in the sidebar right to the search engine results.
  • Supports the following search engines:
  • Automatic light or dark theme detection

Works with: Firefox, Chrome

* experimental, please read this if you have problems

Usage

After installation the extension needs to be configured and connected to your linkding instance. Either open the extension options in the browser extension manager or follow the link in the new linkding injector box on the search page of google or duckduckgo.

Once the extension is properly configured linkding search results will show in the right sidebar. If there are no search results nothing will appear.

Screenshots

duckduckgo google

Installation

Firefox: Mozilla Addon Store

Chrome: Chrome Web Store

Manual installation

Firefox

Run the build as described below and then follow the instructions here to load it into Firefox.

Chrome

Run the build as described below and then follow the instructions here to load it into Chrome.

Build

Requirements

  • Latest LTS Node version (v14+)
  • Latest LTS NPM version (v6+)
  • bash (on Linux) or powershell (on Windows)
  • npx (included with npm v5.2+)

Internally, we use web-ext to bundle a distribution package for the extension for Firefox. You do not need to install web-ext. Note that web-ext will generate a zip file which can also be used for the Chrome Web Store (but see the next section for Chrome-specific build instructions).

Then run the following script to generate a build (might need to make the file executable on Linux using chmod +x build.sh):

./build.sh # Linux
./build.ps1 # Windows

The script does:

  • Install all dependencies using NPM
  • Runs rollup to transpile and minify source files, with output written to the build directory
  • Run web-ext to package the extension for uploading to the Mozilla addon store

After the build the root directory contains the complete, unpackaged extension. Use the manifest.json file to load it manually into the browser.

The packaged extension can be found in the web-ext-artifacts folder.

For developing you might prefer using npm run dev to create an unpackaged development build. This won't package the extension and won't minify the code but is faster and makes debugging in the browser easier.

Building for Chrome-based browsers

Chrome switched over to Manifest V3. Same build instructions as above apply, but before building you need to checkout the chrome_manifest_v3 branch. The only relevant difference in that branch is the manifest.json.

Acknowledgements

This extension reuses and adapts code from the official linkding extension.

linkding-injector's People

Contributors

danbush avatar fivefold avatar sevichecc 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  avatar

linkding-injector's Issues

Thank you!

Hey,

Just wanted to say thank you for this extension. I just installed linkding for the first time, mostly because of your extension. I'm forever finding useful information and then forgetting about it. :-)

Best wishes from New Zeaaland,
Adam.

Doesn't match against link tags unless use #

Hello,

To my surprise, I just realised that linkding-injector doesn't seem to substring search tags. For example, I just added a link with a tag interviewing, but when I go to DDG and search for interviewing it doesn't show up (it does show up if I search for #interviewing).

It would be great if tags were searched along with everything else.

Thanks again for a great addition to linkding, I use it every day!

Cheers,
Adam.

SearX/SearXNG support

TODO: implement support for SearX/SearXNG

I looked at the match patterns again and a compromise solution might be to match something like https://*/search?* and https://*/search?*. This would match any URL with a path ending in search (and optional a query string.
Examples: https://mysite.com/search https://mysite.com/search?s=mysearchterm

SearXNG which is a fork of SearX supports the /search and you can find a list of public instances here to test. https://searx.space/

Searching for tags

Just started using linkding and found this extension and I think it's a pretty cool idea!
The only thing I'm missing is having bookmarks listed which don't have the keyword in the title or description but only in the tag I've added.

So e.g. I've created a bookmark on a site that has a cool button design or whatever and I've given it the tags "button" and "design". When I'm searching for something like "button design" on e.g. duckduckgo I'd like to see that bookmark.

Maybe it would even be nice to also see it if only some of these tags are in the keywords I've searched for. So even if I'm searching for "design idea button" I'd see that same bookmark which only has the tags "button" and "design" but is missing the tag "idea".
Might not always be what you want so maybe only do that if there isn't X (specified amount of bookmarks) matching results already.

Support for Shaarli

Hey there!

Love this extension! Somehow Linkding still has a couple of issues that doesn't make it production ready for me.

I've use Shaarli for years and I would love a similar extension compatible with it.

I've looked at your code (even though I'm not versed in building browser extensions) and it looks like it would be fairly simple to transpose API calls from Linkding to Shaarli API calls.

Only difference is around auth, Shaarli works on a JWT token: https://github.com/shaarli/api-documentation/blob/master/api-authentication.md

API call for search is fairly classic: https://bookmark.example.com/api/v1/links?searchterm=linux&limit=10

Output:

[
	{
		"id": 4956,
		"url": "https:\/\/addons.mozilla.org\/en-GB\/firefox\/addon\/blah\/",
		"shorturl": "PJJIcg",
		"title": "the title",
		"description": "the description",
		"tags": [
			"extension",
			"firefox"
		],
		"private": false,
		"created": "2022-12-18T22:13:45+01:00",
		"updated": "2022-12-18T22:14:00+01:00"
	}
]

I can spin up a Shaarli instance if needed.

Support for mobile

Thanks for the neat extension :)

Linkding's support on mobile is very limited right now. Regardless, this would be a great extension to also use on mobile devices. Right now the injector doesn't seem to appear?

I did a rough mockup of what this could look like:

Screen Shot 2023-03-19 at 12 27 58

Firefox extension connected, but no search results shown

I'm trying to get the firefox browser extension set up, and I'm having issues getting duckduckgo or google to show the linkding search results. My extension is connected to my linkding instance, and I can see the the search requests going through in my linkding docker containers logs. However, no search results are presented in either duckduckgo or google.

My firefox version is 113.0.1, and I've tried the same thing with Brave browser version 113.1.51.118. Any help of guidance on this issue would be much appreciate!

domain restriction

Why wasn't it possible to restrict the visible to domains to the two search engines this was intended for?

Also, with external communication, why is that necessary?

duckduckgo support is broken

DDG changed their DOM and the injection script can't find the sidebar. See #15

The new sidebar element uses the class react-results--sidebar. The sidebar elements get created, even if there is no content (same as before).

Support for Qwant

Hi!

First of all, excellent extension! It adds so much functionality to linkding.

Nowadays i'm using more and more Qwant (https://www.qwant.com/) would you be willing to add it to the extension?

Thanks!

Theme option in settings / SearX support

It would be great if there could be a dark/light theme option in the addon settings.
Additionally how much work would it be to support a search engine like SearX?

Support for Startpage

Startpage.com is a search engine that proxies Google's results.

Useful if you want to use Google in a more private fashion.

Duckduckgo injection broken

          @Fivefold Sorry to necro this issue but i noticed that in version 1.3.4 with duckduckgo the injector is not working.

imagem

linkding injector: no message and no search results searchInjection.js:150:12 <anónimo> searchInjection.js:150

I did try with google and it works as expected.

Originally posted by @GulyFMG in #18 (comment)

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.