TL;DR: I wrote OnChrome, a Firefox extension that opens the urls you want on Chrome. To use it, make sure you install the native app. Why a native app? well, keep on reading :P
In case you missed it, Google is planning to change what extensions can do with the manifest v3. A bunch of things are great (I really really think that as things stand, extensions are really dangerous) but the fact that they’re severely limiting how Ad Blockers can do their thing is a bit worrysome to me.
The uBlock Origin author mentions this move is consistent with their 10K filling where they acknowledge that ad blockers could adversely affect their operating results. It makes perfect sense for them.
I want to be able to use extensions to finely tune how I live the web. I used Firefox before Chrome existed… and the only reason why I switched was because Chrome was faster. Firefox has come a long way and I feel it as fast as Chrome now.
But… some sites don’t work in Firefox!
This is the main problem I hit when I tried to do the switch. Even if Firefox supposedly works with Hangouts and Meet, this is what I see when I open a hangout on Firefox:
And with meet, everything seemed like it was working… but nobody on the call could hear me despite the green indicator showing I was indeed talking and not muted. I opened the meet url in Chrome and boom! everything worked.
How can I fix it?
I’d like to use Firefox for evertyhing except for those sites where I have a reason not to. I was looking for extensions that did this… but only found extensions that let you say “open this page in Chrome”. That means the following flow would happen to me 10 times per day:
- Follow a link to a hangout or a meet
- Click on the “Send to Chrome” button
It may seem like not a big deal, but this is exactly the kind of things that make me nuts, and a good reason for me to stick with Chrome.
But maybe I can build an extension where I specified the urls beforehand and it would work this way:
- Follow a link to a hangout or a meet
- Firefox closes the tab and Chrome is opened exactly where I was on Firefox
In this scenario, I don’t need to do anything different. I just visit sites on Firefox, and it decides (based on the rules I set up) if it should use Chrome for it or not.
How do these extensions do their magic?
Firefox doesn’t let extensions connect directly to the OS and tell “hey, open Chrome for me!” (thankfully they don’t, that would be a security nightmare). But what Firefox does allow is using Native Messaging (well, it’s not really just Firefox… it’s a WebExtensions API, but I only care about Firefox here).
By using native messaging, an extension can connect to an application on the user’s machine and exchange messages. The applications that receives those messages needs to explicitly list which extensions can send it messages.
So… all these extensions require you to install something. That is not the bestest experience for an extension user, but it makes sense.
So I went ahead and built OnChrome!
The initial version (without allowing me to change URLs anywhere other than its source code) took me 30 minutes to build.
I was using python for the native application… but if I wanted to distribute it, people would need to install python for the extension to work.
So I implemented the native app in Go. This got me nice binaries that run in Windows and MacOS, have 0 dependencies and are easy to deploy. You can see their source code here. Also, they don’t require privileged access at all, that’s nice.
Things are different in Windows and MacOS (the Windows version plays a lot with the registry for instance). But the code is easy to follow, so if you’re concerned with installing stuff on your machine (as you should be) you should be able to easily compile them yourself.
Total time? a night that I went to bed at 3am + a Sunday evening for the Go stuff + a beautiful logo.
How can I install the extension?
Installing the extension should be fairly straightforward (although a bit more involved than installing an extension that doesn’t use native messaging).
- Install the Firefox extension from their store
- Download the native application for your environment and follon the instructions on that page
And that should be it! Here you can see it working:
How can I completely uninstall the extension?
The only weird thing the app does is registering it to receive messages from the extension (that is either creating a file on MacOS or adding a registry key on Windows).
To completely remove the extension, the application, and any traces of it you should:
- Run the application
2to unregister it
- Remove the native application
- Uninstall the extension from Firefox
And that’s it!
I’m going to probably add things like “Open on Chrome” by right-clicking on a link… but other than that, it does exactly what I wanted it to :)
You can find its source code and more stuff at onchro.me.
Have comments? tweet me at @g3rv4!