diff --git a/app/src/main/java/org/mozilla/focus/fragment/BrowserFragment.kt b/app/src/main/java/org/mozilla/focus/fragment/BrowserFragment.kt index fa4db276771..f72d010afa8 100644 --- a/app/src/main/java/org/mozilla/focus/fragment/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/focus/fragment/BrowserFragment.kt @@ -50,6 +50,7 @@ import android.widget.ImageView import android.widget.TextView import android.widget.Toast import kotlinx.android.synthetic.main.browser_display_toolbar.* +import kotlinx.android.synthetic.main.fragment_browser.* import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager import mozilla.components.lib.crash.Crash @@ -687,8 +688,13 @@ class BrowserFragment : WebFragment(), LifecycleObserver, View.OnClickListener, fragmentManager .beginTransaction() - .add(R.id.container, crashReporterFragment, CrashReporterFragment.FRAGMENT_TAG) + .addToBackStack(null) + .add(R.id.crash_container, crashReporterFragment, CrashReporterFragment.FRAGMENT_TAG) .commit() + + crash_container.visibility = View.VISIBLE + tabs.hide() + erase.hide() } internal fun showAddToHomescreenDialog(url: String, title: String) { diff --git a/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt b/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt index 001e30bf08a..5d42994c0a1 100644 --- a/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt +++ b/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt @@ -123,7 +123,7 @@ class GeckoWebViewProvider : IWebViewProvider { SharedPreferences.OnSharedPreferenceChangeListener { private var callback: IWebView.Callback? = null private var findListener: IFindListener? = null - private var currentUrl: String = "about:blank" + private var currentUrl: String = ABOUT_BLANK private var canGoBack: Boolean = false private var canGoForward: Boolean = false private var isSecure: Boolean = false @@ -373,12 +373,12 @@ class GeckoWebViewProvider : IWebViewProvider { } override fun onCrash(session: GeckoSession) { - Log.i(TAG, "Crashed, opening new session") geckoSession.close() geckoSession = createGeckoSession() applySettingsAndSetDelegates() geckoSession.open(geckoRuntime!!) setSession(geckoSession) + currentUrl = ABOUT_BLANK geckoSession.loadUri(currentUrl) } diff --git a/app/src/main/res/layout/fragment_browser.xml b/app/src/main/res/layout/fragment_browser.xml index 0e60e8527ef..b725445a529 100644 --- a/app/src/main/res/layout/fragment_browser.xml +++ b/app/src/main/res/layout/fragment_browser.xml @@ -45,6 +45,13 @@ + + diff --git a/app/src/main/res/layout/fragment_crash_reporter.xml b/app/src/main/res/layout/fragment_crash_reporter.xml index d6757413355..a0e4c11cc76 100644 --- a/app/src/main/res/layout/fragment_crash_reporter.xml +++ b/app/src/main/res/layout/fragment_crash_reporter.xml @@ -9,65 +9,69 @@ - - + app:layout_constraintWidth_percent="0.8" + tools:text="@string/crash_report_send_crash_label" />