Giter Site home page Giter Site logo

Comments (18)

ahunt avatar ahunt commented on June 6, 2024 1

Fennec shows the following prompt when you open an external link in private browsing - I'll do the same in Focus for now:
URL
This link will open in Google Play Store. Are you sure you want to exit Private Browsing?
[No] [Yes]

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

@antlam : What behaviour do we want? A user is unlikely to know that a link will redirect to an external app until they've clicked on it - do we need a notification to confirm that they are leaving focus (and do we need to ask them if they want to clear their browsing data then?).

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

Note to whoever implements this: behaviour when opening a link from scratch (i.e. start focus, paste link) is different to behaviour when opening a link when you're already browsing.

  • Opening link: shouldOverrideUrlLoading() is called, followed by shouldInterceptRequest()
  • Opening from scratch: we've added notifyCurrentURL (since shouldOverrideUrlLoading() isn't called in this case), followed by shouldIntereceptRequest().

We should make sure both work acceptably.

from focus-android.

antlam avatar antlam commented on June 6, 2024

@ahunt perfect! that's exactly what I was going to say 💯

But instead of "Private Browsing" perhaps we should use the product name. That is, "Firefox Focus".

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

// Edit: disregard - I've spoken to antlam, and we'll stick with the firefox for android behaviour right now. I'll try to put a document together with screenshots/descriptions in case we want to revisit this.

One more UX thing: If there are multiple apps that support a given link (e.g. email):

  • Firefox normal browsing:
    -- If a default app is set, the app is opened directly
    -- If no default app exists:

Open With
[App 1]
[App ...N]
[Just once] [Always]

  • Firefox private browsing: if more than one app is available, we always show:

Exit Private Browsing?
[App 1] [App 2]...[App3]

(We're using the OS app picker for both, but on at least Android 7 one of those is horizontal, and one is vertical. We don't show which app is the default for private browsing, but it's still possible for us to ask Android which one is the default.)

For now I've copied the firefox private browsing mode behaviour. I'm wondering if it's better to just try to use the default app if one is set (we don't offer that choice in normal browsing after all)? We could still add a "open in other app" option to the "exit focus" confirmation dialog in this scenario.

(I have screenshots, but screenshot upload is failing today...)

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

Here's a screenshot of the current dialog (I haven't done anything related to its appearance, that's just the default dialog appearance with our current theme) - I'm not sure that using the link as a title is ideal (that's what fennec does):
dialog_preview

I'm also not too sure what exactly to show if we need to redirect to the play store, this is the current state of things:
dialog_play

Finally, I still need to handle completely unsupported links: we can only redirect to the play store if a link contains an android app/package name (so generic random schemes won't do anything, e.g. ssh://...... is ignored). I still need to add code to handle that case, for now I'm redirecting to a non-existent about:error page.

I've also put together a quick document summarising what various browsers do when opening external links, just in case we need to revisit our behaviour decision.
https://docs.google.com/a/mozilla.com/document/d/1KZVpSpptLsfv72qLEUXooxwM2bgcW0qWT4g2h_9bMpM/edit?usp=sharing

from focus-android.

antlam avatar antlam commented on June 6, 2024

@ahunt For the link/buttons, can we use the blue we're using in the Settings UI?

For the "No app to handle link" I'll ask Michelle.

Also thanks for the doc! it's really helpful :)

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

(Note to self: I still need to set the right colours as per #32 (comment) , before closing)

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

How's this?
updatedstyle

from focus-android.

antlam avatar antlam commented on June 6, 2024

from Michelle:

For the case where there is an app that can handle the link, instead of showing the link how about:
Open link in another app
You can leave Firefox Focus to open this link in .
CANCEL | OK

For the case where there is no app to handle this link:
Find an app that can open link
None of the apps on your device can open this link. You can leave Firefox Focus to search the Google Play Store for an app that can.
CANCEL | OK

from focus-android.

pocmo avatar pocmo commented on June 6, 2024

None of the apps on your device can open this link. You can leave Firefox Focus to search the Google Play Store for an app that can.

"the" in the second sentence might be a problem. With placeholders (and without "the") the string would be:

None of the apps on your device can open this link. You can leave %1$s to search %2$s for an app that can.

And in the case of Google Play (app name = "Play Store") on my device this results in:

None of the apps on your device can open this link. You can leave Firefox Focus to search Play Store for an app that can.

Is this acceptable?

from focus-android.

mheubusch avatar mheubusch commented on June 6, 2024

that is great, thanks for reviewing carefully and catching this! definitely remove the "the"

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

One thing to note for the second (no-app) case:

  • The link might contain an app ID, in which case we can ask to open google play to allow looking at that specific app. This is what firefox already does, and what we already have in focus. (Note: we don't have access to the app name, only the app id, which might be something like org.mozilla.firefox).
  • The link might not contain an app ID - in which case it's a trickier, since the user might not even know what to search for. The play store doesn't let us search by link/protocol type, so all we're doing is dumping them into the play store with a probably cryptic link as their only hint. (Firefox does absolutely nothing in this situation, right now focus redirects to a page explaining that this protocol isn't supported).

(Opening the play store to search for an unspecified app doesn't seem too helpful IMHO, since research will be needed to find out what app might support a specific protocol. Websites aren't likely to use a weird protocol in the first place because of this.)

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

(FWIW Chrome also does nothing if you have an unsupported link (e.g. ssh:......). It only opens the play store if the link specifies the exact desired app.)

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

@antlam Do we still want the blue title now that we're showing actual text (instead of the link):
v3_1

from focus-android.

antlam avatar antlam commented on June 6, 2024

@ahunt

@antlam Do we still want the blue title now that we're showing actual text (instead of the link):

Nope! Keep it white :)

from focus-android.

antlam avatar antlam commented on June 6, 2024

@ahunt can you quickly comment in here when you have the chance? just to summarize what we decided for the 1% use case and the 99% use case :)

Thanks!

from focus-android.

ahunt avatar ahunt commented on June 6, 2024

Our link behaviour is:

  • Normal web link -> open it
  • External link: multiple scenarios:
    -- Link handled by existing app:
    --- Show confirmation dialog if only one target app exists
    --- Show selector if multiple target apps exist
    -- No target app exists:
    --- Link includes target app (e.g. a link designed to open yelp/google play/etc): we ask to open the Play Store [This is likely for 99% of links that aren't an email address or phone number]
    --- Link doesn't include target app: show error page (Note: both Chrome and Firefox do nothing in this scenario) [1% scenario]

from focus-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.