Open Bug 1483677 Opened 6 years ago Updated 9 months ago

Add historyUrl to GeckoSession.loadData

Categories

(GeckoView :: General, enhancement, P3)

Unspecified
Android
enhancement

Tracking

(geckoview62 wontfix, geckoview64 wontfix, geckoview65 affected, geckoview66 affected, firefox63 wontfix, firefox64 wontfix, firefox65 affected, firefox66 affected)

REOPENED
Tracking Status
geckoview62 --- wontfix
geckoview64 --- wontfix
geckoview65 --- affected
geckoview66 --- affected
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 --- affected
firefox66 --- affected

People

(Reporter: jonalmeida, Unassigned)

Details

(Whiteboard: [geckoview:m92)

The Android Webview's version of loadDataWithBaseUri[1] has an argument to show a url in the browser history.

Focus[2] with the system WebView is currently using it to show 'focus:about' in the URL and history:
```
public static final String URL_ABOUT = "focus:about";
  
webView.loadData(URL_ABOUT, data, "text/html", "UTF-8", URL_ABOUT);
```

We'd like to support this in GeckoView as a nice-to-have.


[1]: https://developer.android.com/reference/android/webkit/WebView#loadDataWithBaseURL(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)
[2]: https://github.com/mozilla-mobile/focus-android/blob/5305b1d46c83ff98b786e68e8b850711328e83a7/app/src/main/java/org/mozilla/focus/browser/LocalizedContent.java#L75
Closing this since since GV dropped support for baseUrl so there's no need to request historyUrl. See bug 1478777.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
I'm reopening this bug because we're realizing with Focus and A-C that having support for historyUrl is likely necessary. For focus:about I had a workaround to override the URL being displayed when the data URL was being used, but when we are now adding overridden error pages through loadData, we need the URL in history to represent the failed URL, not the data URL from loadData so that when the user reloads they are reloading the failed URL not the loaded data.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Emily says we don't need to fix in GV 62. She has a workaround for Focus 7.0. She can overload the appearance of the URL bar to display the websites URL, but then reloading the page that received an error will reload the data: URL page again. And if she instead just uses loadUri, then the data: URL will be in history when the user presses back.
Whiteboard: [geckoview:klar:p2]
There is a new API for error pages in 63[0] which will make those work as you expect without the need for any changes to loadData(). You'll simply return the data: url in the error callback and the location will stay on the failed page.

[0] https://mozilla.github.io/geckoview/javadoc/mozilla-central/org/mozilla/geckoview/GeckoSession.NavigationDelegate.html#onLoadError-org.mozilla.geckoview.GeckoSession-java.lang.String-int-int-
Thanks snorp!! So these will be ready for 63? Which GV version are they available in now to try out?
ekager, a-c is adding support[0] for these error pages now as well.

[0]: https://github.com/mozilla-mobile/android-components/pull/794
(In reply to Emily Kager [:ekager] from comment #6)
> Thanks snorp!! So these will be ready for 63? Which GV version are they
> available in now to try out?

It's in 63 currently.
I'm going to put this as a P3 since the error page case is handled via the new error page API.
Priority: -- → P3
Product: Firefox for Android → GeckoView
This has come up again for loading other about pages in the Reference/AC Sample Browsers[0]. I don't think we'd want to add a workaround for it like in Focus since it's probably better to have a cleaner solution if possible.


[0]: https://github.com/mozilla-mobile/android-components/issues/1455
OS: Unspecified → Android
Priority: P3 → P2
Whiteboard: [geckoview:klar:p2] → [geckoview:fenix:p2]
Rank: 25
Whiteboard: [geckoview:fenix:p2]
Severity: normal → N/A
Whiteboard: [geckoview:m88]
Whiteboard: [geckoview:m88] → [geckoview:m89]
Priority: P2 → P3
Whiteboard: [geckoview:m89] → [geckoview:m92
Rank: 25 → 333
Flags: needinfo?(Jcash0464)

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit BugBot documentation.

Flags: needinfo?(Jcash0464)
You need to log in before you can comment on or make changes to this bug.