Fivefold / linkding-injector

Injects search results from the linkding bookmark service into search pages like google and duckduckgo
MIT License
216 stars 8 forks source link

Support for mobile #10

Open qcasey opened 1 year ago

qcasey commented 1 year ago

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

Fivefold commented 1 year ago

Hey, thanks for the suggestion and the nice mockup!

Unfortunately I have no experience with developing and debugging browser extensions for mobile browsers, so don't expect to see this any time soon. Or are you offering to implement this via PR?

Right now the injector doesn't seem to appear?

Did you try out the extension in a mobile browser? If so, which one did you use?

qcasey commented 1 year ago

Did you try out the extension in a mobile browser? If so, which one did you use?

Firefox Nightly, which has an option for untested extensions.

Unfortunately I have no experience with developing and debugging browser extensions for mobile browsers, so don't expect to see this any time soon. Or are you offering to implement this via PR?

Totally OK, I don't have a ton of time either I just wanted to check if it's something you've tried yet, and if you'd accept a PR (?). When I get some free time I'll try to put this together. I suspect it's not appearing because mobile Google/DDG is missing the sidebar element

Fivefold commented 1 year ago

if you'd accept a PR (?)

definitely. If you do decide to work on it I'd greatly appreciate some testing/debugging instructions, since like I said I don't have experience with this and would have to maintain this in the future.

I suspect it's not appearing because mobile Google/DDG is missing the sidebar element

That would be my first guess as well. The content script locates the sidebar element via document.querySelector() and the relevant id of the sidebar and then injects the html. In the case of google it actually constructs the sidebar element, since google completely removes it if there is no sidebar content (other search engines just have an empty sidebar element)

https://github.com/Fivefold/linkding-injector/blob/b3d55b40b3648af07358744ab124d0959d53f11b/src/searchInjection.js#L156-L172

So if you can debug on mobile firefox you could try to search in the source code for a div with id "rhs" on google to see if the injection works at all.

Fivefold commented 2 weeks ago

You can now install the extension on regular Firefox for Android as well, using a (clunky) workaround:

  1. Go to the firefox extension page for the injector extension.
  2. Switch to desktop mode (by clicking on the three dots next to the address line and then on "Desktop site").
  3. You can now install the extension.
  4. Navigate to the extension settings directly through the firefox settings (Settings > Extensions > linkding injector > Settings). Accessing the injector settings via the cogwheel in the injection box won't work.
  5. Add your connection data and configure the extension.

Unfortunately, injector results will only be shown if you also access the search pages in desktop mode, as the sidebar is hidden in the mobile view. Maybe I can add a different injection method for mobile views (injecting into the regular results area), but it won't happen anytime soon. Pull requests are welcome however, as always.