Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Trying to open page in external browser might result in crash #108

Closed
Tunous opened this issue Nov 5, 2019 · 3 comments
Closed

Trying to open page in external browser might result in crash #108

Tunous opened this issue Nov 5, 2019 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@Tunous
Copy link
Owner

Tunous commented Nov 5, 2019

Description

Precondition: A user has no installed browser

When attempting to open page in external browser Dawn crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any link which will open in internal browser
  2. Click on more options top bar item
  3. Click on 'Open in browser' item

Expected behavior
Most likely an error message telling the user that no browser was found should be displayed.

Hints for fixing

The issue described here is caused by the following line:

startActivity(Intents.createForOpeningUrl(webView.getUrl()));

In this case ActivityNotFoundException exception is thrown which crashes the app. The issue can occur everywhere where intent from Intents.createForOpeningUrl is passed to Context.startActivity. We should instead check whether the created intent can be opened or handle the exception and inform the user about the problem.

@Tunous Tunous added bug Something isn't working help wanted Extra attention is needed labels Nov 5, 2019
@Tunous
Copy link
Owner Author

Tunous commented Nov 5, 2019

Also can happen here:

customTabsIntent.launchUrl(this, Uri.parse(url));

@SubhrajyotiSen
Copy link

Has this been resolved? If not, I can pick it up

@Tunous
Copy link
Owner Author

Tunous commented May 3, 2020

@SubhrajyotiSen It has not been fixed by anyone yet. Feel free to give it a try.

@Tunous Tunous added this to the 0.9.1 milestone May 4, 2020
@Tunous Tunous closed this as completed May 4, 2020
msfjarvis added a commit to msfjarvis/Dawn that referenced this issue Aug 5, 2020
…jarvis/swipe-gesture-icon-position' into features

* msfjarvis/multiple_accounts: (24 commits)
  Adds multiple accounts support
  Prepare next version
  Update changelog for 0.9.1 (Tunous#198)
  Force logout all users (Tunous#196)
  Handle exceptions while opening a browser (Tunous#108) (Tunous#193)
  Prevent selection of negative ranges in SelectionLimitingTextView (fixes Tunous#190) (Tunous#194)
  Prepare next version
  Release 0.9.0 (Tunous#184)
  Release workflow (Tunous#185)
  Fix image loading issues due to http urls (Tunous#183)
  Selftext selection (Tunous#178)
  Submission title selection (Tunous#182)
  Update changelog with missed changes
  Wrap comment byline when it is too long to fit in one line (Tunous#145)
  Revert "Run Debug workflow only on push"
  Upgrade to Gradle 6.3 and add checksum field for F-Droid (Tunous#180)
  Run Debug workflow only on push
  Upgrade Gradle to 6.2.1 (Tunous#152)
  Use GitHub Actions (#72)
  Switch to on-device link unfurler (Tunous#138)
  ...

* msfjarvis/swipe-gesture-icon-position: (26 commits)
  Return false to keep the touch flow going
  Make the gestures' icons follow touch event position on Y
  Swipe Actions' icons at same level as touch event
  Prepare next version
  Update changelog for 0.9.1 (Tunous#198)
  Force logout all users (Tunous#196)
  Handle exceptions while opening a browser (Tunous#108) (Tunous#193)
  Prevent selection of negative ranges in SelectionLimitingTextView (fixes Tunous#190) (Tunous#194)
  Prepare next version
  Release 0.9.0 (Tunous#184)
  Release workflow (Tunous#185)
  Fix image loading issues due to http urls (Tunous#183)
  Selftext selection (Tunous#178)
  Submission title selection (Tunous#182)
  Update changelog with missed changes
  Wrap comment byline when it is too long to fit in one line (Tunous#145)
  Revert "Run Debug workflow only on push"
  Upgrade to Gradle 6.3 and add checksum field for F-Droid (Tunous#180)
  Run Debug workflow only on push
  Upgrade Gradle to 6.2.1 (Tunous#152)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants