fwextensions / QuicKey

Jump between recent tabs in Chrome via keyboard shortcuts or a most recently used (MRU) menu.
https://fwextensions.github.io/QuicKey
214 stars 21 forks source link

Support Firefox #64

Closed infokiller closed 1 year ago

infokiller commented 2 years ago

Hey again, I started using Firefox more and more recently and immediately missed this extension. Will you be open to a PR that adds Firefox support? From my experience in extensions I've developed it's fairly easy. Will try to send a PR soon and hope you'll be open to merge, but if not that's fine too.

fwextensions commented 2 years ago

I haven't used FF in a while. It natively supports MRU navigation, right? So this would only be for searching for tabs?

QuicKey uses chrome-promise to wrap the Chrome APIs and return promises. So I think it may be fairly easy to just return the browser global in FF from there, which supports promises natively. Haven't looked in detail at what it would take, though.

infokiller commented 2 years ago

I haven't used FF in a while. It natively supports MRU navigation, right? So this would only be for searching for tabs?

Searching for tabs, bookmarks, and history with QuicKey's great fuzzy search.

QuicKey uses chrome-promise to wrap the Chrome APIs and return promises. So I think it may be fairly easy to just return the browser global in FF from there, which supports promises natively. Haven't looked in detail at what it would take, though.

I'll look into that. On the day I opened the issue I was able to make it work without the UI (https://github.com/infokiller/QuicKey/tree/firefox-support), i.e. you can use keyboard shortcuts, type your query, hit enter and switch to the right tab. Not sure why the UI wasn't rendered, I'll try to fix it when I have more free time.

fwextensions commented 2 years ago

Not sure why the UI wasn't rendered,

Weird. If you're on a Mac, I wonder if it's the delay that I put in a long time ago to work around a Chrome bug where it wouldn't resize the popup to its content if it opened immediately. It's in src/js/popup/main.js.

ajitid commented 2 years ago

@infokiller — can confirm that your branch renders UI on Windows (albeit with some CSS changes applied).

@fwextensions — quick question, why is there a fixed height applied to the body?

fwextensions commented 2 years ago

I believe at one point early on, the popup height was collapsing because the body started out empty, before the React code rendered anything. So that might be better as min-height. Not sure it's still needed anymore, as the search box and other components are pre-rendered during the build, so there's some static HTML to show as soon as the popup opens.

If the UI renders on Windows, then it may well be the delay on Mac that's causing the issue.

infokiller commented 2 years ago

I actually use Linux but I'll try to see if I get different results on Windows

ajitid commented 2 years ago

Just checked on Ubuntu using WSL and the UI does render on my machine. I think you meant pressing alt+Q shows input box but typing in it doesn't shows any result. This is a CSS issue and I've raised a PR for the same.

Turns out making chromebrowser change isn't necessary at all. I mistakenly ran web-ext directly on master and it ran exactly the same as with your (@infokiller 's) branch changes applied. (I've created a signed extension if you want to check it out.)

The only thing that is not working in Firefox is alt+Q navigation in private windows:-

infokiller commented 2 years ago

Thanks @ajitid! For me, it didn't render anything.

alpenandrew commented 1 year ago

I haven't used FF in a while. It natively supports MRU navigation, right? So this would only be for searching for tabs?

Searching for tabs, bookmarks, and history with QuicKey's great fuzzy search.

QuicKey uses chrome-promise to wrap the Chrome APIs and return promises. So I think it may be fairly easy to just return the browser global in FF from there, which supports promises natively. Haven't looked in detail at what it would take, though.

I'll look into that. On the day I opened the issue I was able to make it work without the UI (https://github.com/infokiller/QuicKey/tree/firefox-support), i.e. you can use keyboard shortcuts, type your query, hit enter and switch to the right tab. Not sure why the UI wasn't rendered, I'll try to fix it when I have more free time.

For someone who is totally tech inept how would I get this working on Firefox?

Also, @fwextensions it seems like Chromium's impending changes about ad blocking would make FF support a little more worthwhile.

fwextensions commented 1 year ago

After faffing about in FF's somewhat terrible devtools, I belatedly realized that @ajitid's fix in his PR on @infokiller's branch is all that's required to show the menu. Chrome seems to treat a height on the body as a min-height, while FF treats it as max-height. Removing that allowed the menu to expand to show the results list. (I didn't see any content flash due to a scrollbar, though.)

I'll take a look at submitting a version to the FF store.

fwextensions commented 1 year ago

I have Firefox support in a branch. I keep finding little things that don't work correctly in FF, though. So I'm working through those.

fwextensions commented 1 year ago

I've submitted 1.8.0 to Mozilla for review. We'll see how long it takes.

One limitation is it won't work in private windows. Firefox doesn't support some background page features that Chrome does, and which apparently I've relied on. It may work better once I migrate everything to manifest V3 for Chrome

infokiller commented 1 year ago

Thanks a lot @fwextensions, I'll install it the minute it becomes available (already testing my branch loading from a local dir)

fwextensions commented 1 year ago

It's available in the Firefox store now: https://addons.mozilla.org/en-US/firefox/addon/quickey-the-quick-tab-switcher/

🔥🦊