ChrisNZL / Fauxbar

An alternative to Chrome's Omnibox.
https://chrome.google.com/webstore/detail/fauxbar/hibkhcnpkakjniplpfblaoikiggkopka
MIT License
89 stars 13 forks source link

Fauxbar controls Chromium setting "On startup" #41

Closed Chealer closed 5 years ago

Chealer commented 5 years ago

I have been having issues starting Chromium. When it starts, it offers to restore the last session, but if I fail to do so, and that seems to be very easy (possibly due to a Chrome usability bug), I can lose the tabs previously open (they can be recovered, but it can be complicated).

So I just went to Chromium Settings to check the value of the On startup preference, and was surprised to see that the setting is forced to "Open the New Tab page", with a mention that "Fauxbar is controlling this setting".

I'm not sure whether this is a bug, but if not, that is not something I expected from Fauxbar.

ChrisNZL commented 5 years ago

There's a setting in Fauxbar that is on by default: Fauxbar > Options > General > Override Chrome's New Tab button.

Part of Fauxbar's "ease of use" ideals is to have Fauxbar's Address Box be selected when a new tab is open.

One caveat of Chrome though, is that extensions that use the New Tab Page cannot automatically focus an input field on the page itself -- a "new tab" will always have Chrome's Omnibox focused. There is no way to tell Chrome to shift the selected field off of the Omnibox and onto the extension's page.

So as a workaround, if the above option is selected, Fauxbar bypasses this as best it can by detecting when a New Tab Page is opened, closing the tab, and immediately opening Fauxbar's main page instead -- effectively making it feel like you opened a New Tab Page with Fauxbar present front-and-centre with Fauxbar's Address Box selected, thus saving you from having to press Tab to manually change focus away from Chrome's Omnibox.

But one downside at the moment, is that this happens when Chrome opens for the first time. And if Chrome is presenting you with its "Restore tabs from the previous session?" question -- Fauxbar isn't currently aware this might be presented, so will close that tab and open a Fauxbar tab. So, it's a bug, yeah.

For a future fix, I can probably make Fauxbar not do its "close tab and open new tab" method if the only tab in a window is Chrome's New Tab Page.

For now, suggested workarounds would be to:

Chealer commented 5 years ago

Ah, that explains. I must say I'm a little skeptical though because I managed to use "Restore tabs from the previous session?" a number of times, and I use Fauxbar on all my Chromium installs besides one I almost never use. Unless the initial tab stays longer because Fauxbar is slower at Chromium startup...

Thank you very much for the explanation and workaround suggestion. To expand on workarounds, this page helps when it seems too late.

I agree that not having to press Tab is a feature worth some gymnastics. But if these gymnastics come with such a cost, perhaps the default value of the "Override Chrome's New Tab button" preference should be reconsidered.

Chealer commented 5 years ago

After ChrisNZL's reply, I configured my work PC's Fauxbar disabling the "Override Chrome's New Tab button" preference. That didn't solve the problem though, and today I went to Chrome's options to realize that the "On startup" setting is still controlled by Fauxbar. Even though Fauxbar's "Override Chrome's New Tab button" setting remains disabled :-(

ChrisNZL commented 5 years ago

To completely disable the "On startup" override, you'll need to remove or disable Fauxbar, and install Fauxbar Lite instead.

FAQ entry:

Fauxbar replaces Chrome's New Tab page; Fauxbar Lite does not.

Ideally, the option to replace Chrome's New Tab page or not would be bundled into just the one Fauxbar extension, but due to Chrome's extension API limitations, this option can not be toggled by an extension; it is unchangeable, hard-coded into each extension.

Fauxbar Lite was created to make up for this limitation.

Chealer commented 5 years ago

I believe I figured out why I was only experiencing this sometimes. The problem is when Chrome is automatically started to display a webpage. For example, if I just restarted my PC, open Outlook and click on a link in a message, Chrome opens that page, but only that page and not the previously open tabs. At that point, it must be still possible to recover the previous session's tab, but if I close the tab once I'm done with it, that closes Chrome, and when I get to "really launching Chrome", the session I want to restore has become the pre-previous session, and Chrome doesn't offer restoring those tabs anymore.

Obviously, it's possible to avoid that by keeping Chrome always open, but that requires huge focus. A more reasonable workaround I am considering is to auto-start Chrome.

ChrisNZL commented 5 years ago

For v1.8.0, I've edited newTabCheck.js to perform its window.close() call upon successful new tab creation callback, rather than closing immediately, on the chance that async timing was closing an initial tab prematurely, though I don't think this would close the entire window (JavaScript's window refers to the tab, not an entire Chrome window).

I think this is a more of an issue with Chrome just not remembering which tabs were open previously. I see it a lot when using Chrome on Ubuntu, sessions rarely get restored properly, but they seem to restore properly on Windows. If anything on Windows, I see Fauxbar open itself in a new standalone window sometimes in addition to the previous session that was restored, so it really feels like this is something on Chrome's end, not Fauxbar's.

Still, Fauxbar Lite is the way to go if you want to leave the New Tab Page stuff alone.

Chealer commented 4 years ago

Regarding workarounds, I might be missing some option, but I just experienced the same issue on an install where I'm using Fauxbar Lite :-( On Startup is set to "Continue where you left off". I did not verify that this isn't a Chrome bug, though that seems impossible.

ChrisNZL commented 4 years ago

I've created a new issue: #54 - If Chrome doesn't shut down properly, Fauxbar prevents tabs from being restored?

Need to profile/test to see if Chrome 78 is being bad at restoring tabs, or if Fauxbar and/or Fauxbar Lite is being problematic.