this post was submitted on 23 Jun 2023
18 points (95.0% liked)

Firefox

16764 readers
289 users here now

A place to discuss the news and latest developments on the open-source browser Firefox

founded 4 years ago
MODERATORS
 

Hi everyone,

So I have created a "sublemmy" add-on for lemmy.ml that lets you quickly jump to a community from the address bar in FireFox. Just type 'c firefox', for example, and it will go there and sort the community by new. Useful if you have a few communities you want to check regularly and quickly from any new browser window.

The one caveat is that this tool only works for the website lemmy.ml because that is the site hardwired into the search string, alas. Not sure if there is a way around that (that would maybe take 2 arguments instead of one?) but that's where it's at for now.

Link is included if anyone wants to use it!

top 12 comments
sorted by: hot top controversial new old
[–] ewe 10 points 1 year ago* (last edited 1 year ago) (1 children)

You can do this for any instance without an extension with a custom search engine (on chrome) or bookmark keyword (on firefox)

Firefox:

  1. Create bookmark and add a keyword of "c" and replace the sublemmy name with "%s" in the url.

  1. In url bar, type "c", then space, then the sublemmy name and enter -> goes to sublemmy

Chrome:

  1. Go to settings and find the search engines, select "Add"

  1. Define like this and replace the sublemmy name with "%s" in the url.

  1. From the omnibar, type "c" then space or tab, then the sublemmy, then enter -> goes to sublemmy

[–] [email protected] 1 points 1 year ago (1 children)

Holy crap! TIL! And when did they add this? When I switched from Chrome back to FF years ago, I couldn't find any way to make that happen!

[–] ewe 1 points 1 year ago

Not sure, but I also switched from Chrome to Firefox and was a heavy custom search engine user. When I finally figured it out, how to do bookmark search functionality, it was a game changer.

This has inspired me to dig up away to use a bookmark commandlet in order to take the URL that you are on from another instance and make it into one that is viewing the same content on your instance. In the next day or two I will figure that out and post how to do it. Should be really useful actually!

[–] [email protected] 4 points 1 year ago (2 children)

Would be great to have an option to choose what community you want to use, not just lemmy.ml

[–] ewe 2 points 1 year ago (1 children)

check out my comment below. you can do the same thing for whatever instance with a very simple setup.

[–] [email protected] 1 points 1 year ago (1 children)

Yeah, that's an option too, but it'll require the user to know the parameters required.
In the extension there could be a settings page with specific dropdowns for the extension to automatically create the URL required.

[–] ewe 2 points 1 year ago

Like...a set of bookmarks? I mean, if you really want an extension, thats fine, but it seems like both browsers have these features pretty well solved.

[–] [email protected] 1 points 1 year ago (1 children)

Totally agree! I think that is not so simple as this is alas, and would require an actual add-on instead of just a super simple chrome modification.

[–] [email protected] 1 points 1 year ago

Ahh, I thought it was an actual add-on, I just saw your other comment with the manifest.

[–] [email protected] 3 points 1 year ago (1 children)

Is this up on Github, if not are there any plans to open source the project?

[–] [email protected] 1 points 1 year ago (1 children)

It's literally just a manifest file. In Chrome, you can do it in the Search Engines area, but for some reason it has to be an add-on in FireFox. If someone wants to take it and run with it, I have zero problem with that, TBH. I just posted it since I wrote it for my own convenience in FireFox.

This is the "code" (which is 90% about hello, I am an add-on!).

{

    "manifest_version": 2,
    "name": "Lemmy.ML Community By New",
    "version": "1.0.1",

    "description": "Sorts the searched-for lemmy community by new. So 'c printsf' will return the printsf community already ordered by newest items first.",

    "icons": {
        "48": "icons/icon-48.png"
    },

    "chrome_settings_overrides": {
        "search_provider": {
            "name": "Lemmy Community By New",
            "search_url": "https://lemmy.ml/c/{searchTerms}?sort=New",
            "keyword": "c",
            "favicon_url": "https://lemmy.ml/pictrs/image/fa6d9660-4f1f-4e90-ac73-b897216db6f3.png"
        }
    }

}

[–] [email protected] 1 points 1 year ago

Thanks! While it may just be a manifest, I believe that allowing access no matter how small the project is always a solid option. Who knows, maybe one day a beginner coder may come across this and wonder how to replicate it for their own uses, and while I'm sure there are other sources they could reference having another is always helpful.