Hacker News new | ask | show | jobs
by Joker_vD 1480 days ago
It's actually pretty insane: there is a setting on Android to always use the main browser (Chrome) to open links, I've turned it on, and yet the Gmail app still opens the links in the embedded Chrome browser — which has different cookies, different history that apparently is not synced with my other Chromes, and even looks sli-i-ightly different than "normal" Chrome, somehow.

I've no idea why it is so difficult for apps to open links in the user-selected browser. Isn't it just "xdg-open https://example.com/"?

6 comments

Uninstall chrome and use Firefox, and it works for me with full cookie sharing. There is even an "open in Firefox" in the hamburger drop-down which transfers the page to the browser app without reloading.
As an added bonus, Firefox on Android also support ublock origin.
I get that with Kiwi browser's custom tab as well. Kiwi is a fork of chrome for Android with extension support. Is it not in stock chrome?
Last time I tried Firefox on my Android phone it showed weird drawing artifacts (half/quarter of the page is full black) on pretty must all websites, so thanks for your suggestion but I'd stick with an actually working browser.

In any case, I don't need to bother about whether any "cookie sharing" works or not if I only use one browser, do I?

Can you uninstall chrome from most Android phones? I think I've tried in the past but failed.
Go to Settings, apps, search for Chrome and click the disable button.
The setting you're talking about is probably the OS level setting. There's an additional setting in the GMail app to do the same thing.
> It's actually pretty insane: there is a setting on Android to always use the main browser (Chrome) to open links

That is quite insane indeed.

And on top of that, Android keeps using Chrome as embedded browser. Even if you installed another one. MSHTML all over again.

Before that (Android <5.0 times), you'd have a WebView strictly tied to the OS version and not upgradable if OS goes EOL. Even if device had Chrome 60, webview was based on Chromium 28-30 (depending on manufacturer). With no flexbox etc. As a dev, it was a MASSIVE pain to develop webview integrations with this. On par with IE8. Being able to have the webview upgraded without upgrading OS is a major win.

[Note there are two things: 1) stupid apps putting a generic in-app browser inside the app - that's annoying; and 2) apps using a webview with a bridge between native app and a website, injecting some stuff and properly integrating the embedded website; something impossible to do by opening a website in regular browser]

Many browsers such as Firefox and Kiwi let you enable them for 'custom tabs' which is the term for popup browser windows that you may be thinking of as embedded browsers. I think the setting is usually within the app's settings rather than the general android settings.
> I've no idea why it is so difficult for apps to open links in the user-selected browser. Isn't it just "xdg-open https://example.com/"?

No, theres implementation differences across API levels and the "shared cookie jar" implementation is newer and had some quirks. Its been a couple years since I was deep in this so it might have changed, but that was my experience back then.

> I've no idea why it is so difficult for apps to open links in the user-selected browser.

It's not, it's a conscious decision to open links in chrome from gmail.

That’s odd. I have used the Gmail app on iOS for many years, and as far as I can remember it has always just opened links directly in Safari.
I get a choice of Chrome, Google app (which isn’t even installed) and Safari. I mainly use Firefox, though, and that isn’t an option.