Jump to content

Firefox Assistant


Recommended Posts

Posted (edited)

Like Safari Assistant, but for Firefox.

 

demo.gif

 

Download from GitHub.

 

  • Search Firefox bookmarks
  • Search Firefox browsing history
  • Run bookmarklets
  • Activate & close tabs
  • Add you own custom scripts

 

The workflow requires you to install a corresponding Firefox extension in order to communicate with Firefox.

 

After installing the workflow, run ffass > Install Firefox Extension to get the extension. Once the extension is installed, everything should just work.

 

extension-connected.png

 

The workflow is fairly customisable. You can add your own URL actions via scripts, set custom icons, and assign URL & tab actions and bookmarklets to alternate hotkeys.

 

See the documentation for details.

 

Edited by deanishe
Posted

When I run ffass > Install Firefox Extension I get an error message: “alfred-firefox” cannot be opened because the developer cannot be verified." and my options are to Move to Trash or Cancel. Suggestions?

Posted
6 hours ago, kwehner57 said:

Anyway to configure it so bookmarks open in the current tab instead of opening in a new tab?

 

Not unless Firefox has a setting for that. You could add a script that pastes the URL into the current tab, but realistically, that would need to be added to the extension to work reliably.

Posted

On another note, I haven’t looked at the code but I don’t suppose your extension (or an extension) could bridge the gap with the missing AppleScript functionality to at least return the title and URL of the frontmost tab, could it?

Posted (edited)
1 hour ago, vitor said:

On another note, I haven’t looked at the code but I don’t suppose your extension (or an extension) could bridge the gap with the missing AppleScript functionality to at least return the title and URL of the frontmost tab, could it?

 

It's definitely technically possible. I thought about implementing a CLI client (say /usr/local/bin/firefox-cli) to encapsulate the interaction with Firefox, but that would have made installing the workflow more complicated, and that's ultimately what I wanted to build. I'll probably refactor the workflow to make the bits needed to communicate with the extension importable from other code. It's basically just an RPC server + client. As long as the extension and workflow are installed, other programs can communicate with Firefox, too.

 

As far as the general case goes, the native messaging API for extensions runs an external program or script and passes messages back and forth via STDIN/STDOUT. I added an RPC server, which is how the workflow talks to it, but you could add an HTTP server, too, which would allow just about anything to talk to the extension. I didn't do that because I wanted to use a UNIX socket (more secure), and RPC is simpler.

 

I've also been thinking about how other workflows could call into this one to get the frontmost-tab info. Perhaps like URL schemes on iOS, where you call an external trigger with the name of your own external trigger it should call with the info?

Edited by deanishe
Posted
On 1/11/2020 at 2:17 PM, vitor said:

I’m pretty sure the “right-click and pick Open” method also works for binaries

 

I've added that to the wiki, too. Thanks.

Posted

I apologize if I'm missing something super obvious... but how do you search for a tab and close it? I can only see how to close tabs to the left/right of the result tab.

Posted (edited)
4 hours ago, joeynotjoe said:

I can only see how to close tabs to the left/right of the result tab.

 

That's all there is. The workflow doesn't duplicate actions like "close tab", which already have keyboard shortcuts in Firefox.

Edited by deanishe
  • 1 month later...
Posted

Hi,

 

Would it be possible to add a new command "nf" to open a new firefox window on the current desktop.

 

Each time when I need a new firefox window on another desktop I have to go to firefox (which switches to the last active firefox window) then CMD + N, and then move the window to the desktop where I want it.

 

It would be a great addition for me, since I frequently have to do this.

 

Thanks!

Posted
1 hour ago, Michael_K said:

Each time when I need a new firefox window on another desktop I have to go to firefox (which switches to the last active firefox window) then CMD + N, and then move the window to the desktop where I want it.


Right-click on the Firefox icon in the Dock and choose New Window. That’s a good bit faster. 

  • 4 weeks later...
Posted
On 2/26/2020 at 10:43 AM, deanishe said:


Right-click on the Firefox icon in the Dock and choose New Window. That’s a good bit faster. 

 

Not really to be honest. It requires to take my hand of the keyboard, go with trackpad to side of screen (widescreen) wait for dock to show up (its hidden default) and then do right click etc.

 

CMD + Space + e.g. fn (firefox new) would be a lot faster.

 

  • 1 month later...
Posted

This is very helpful. I'm a heavy Alfred user who prefers Firefox, and I am so happy to find this extension.  Thank you for making and sharing it.

  • 2 weeks later...
Posted

Hi @deanishe

 

Thanks a lot for your efforts working on this workflow!

Did you consider either:

  • getting the "Recommended" badge from Mozilla for your extension (details here)
  • maybe publishing the source code for it

I'd be keen to use this workflow for multiple things, but the paranoid inside is a little worried with an extensions that has "Access your data for all websites" and not curated by Mozilla.

What do you think?

 

 

 

  • 1 month later...
Posted (edited)

I can't get the Firefox extension to connect. Its status always shows "disconnected." I installed the workflow first, then the extension via the workflow. I got through MacOS's security and privacy checks, no problem, but when I run the workflow, it seems to run correctly, but shows "Cannot connect to extension," which makes sense because the extension is always disconnected. I've tried re-starting Firefox. Any troubleshooting suggestions?

 

EDIT: When doing ffass, under "No Connection to Browser," it says, "dial unix /tmp/alfred-firefox.501.sock: connect: no such file or directory"

Edited by JimmyTheSaint
added error info

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...