GeckoSession.loadData() and GeckoSession.loadString() behave differently on non base64 relevant uri input
Categories
(GeckoView :: Core, defect, P3)
Tracking
(firefox65 wontfix, firefox66 wontfix)
People
(Reporter: schae, Unassigned)
References
Details
(Whiteboard: [gvtv:p2])
Context: loading About page raw html to GeckoView on FFTV
geckoSession.loadString(data="<!doctype html><!-- This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this file, - You can obtain one at http://mozilla.org/MPL/2.0/. --><head><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" type="text/css" href="style.css"><style>body, html { background-color: #38383d; color: #f9f9fa; font-family: sans-serif; line-height: 24px; font-size: 14px;}body{ padding-left: 24px; padding-right: 24px; margin-left: 0px; margin-right: 0px;}a { color: #0A9AF4;}/* Make only about page links ("learn more") white /.about a { color: #FFFFFF;}p.subtitle { text-align: center; opacity: .7; margin: 0;}img#wordmark { / We need to set the dp size here, because by default webview assumes the image is not density specific (but since it's an android resource, we get a density specific version). */ width: 180px; display: block; margin-left: auto; margin-right: auto; padding-top: 24px;}</style></head><html><body dir="ltr"> <br> <span style="font-size: 24pt">Firefox for Fire TV 3.5-LAT1</span> <h3>Your Rights</h3> <p id="first">Firefox is free and open source software made by Mozilla and other contributors.</p> <p>Firefox is made available to you under the terms of the <a href="https://www.mozilla.org/en-US/MPL/">Mozilla Public License</a> and other open source licenses.</p> <p>You are not granted any rights or licenses to the trademarks of the Mozilla Foundation or any party, including the Mozilla, Firefox or Firefox names or logos. Additional information may be found <a href="https://www.mozilla.org/foundation/trademarks/policy/">here</a>.</p> <p>Additional source code for Firefox is available under various other free and open source <a href="firefox:licenses">licenses</a>.</p> <p>Firefox also uses blocklists provided by Disconnect, Inc. as separate and independent works under the <a href="firefox:gpl">GNU General Public License v3</a>, and available <a href="https://wiki.mozilla.org/Security/Tracking_protection#Lists">here</a>.</p></body></html>",
mimeType="text/html") shows blank white screen.
geckoSession.loadData() of the same input above renders the html doc correctly.
Relevant FFTV issues:
Reporter | ||
Comment 1•5 years ago
|
||
Or better yet, is it possible to add an internal page with a specific URL (i.e. about:home)?
cc @ Sebastian
Comment 2•5 years ago
|
||
Or better yet, is it possible to add an internal page with a specific URL (i.e. about:home)?
This doesn't seem to be possible in GeckoView currently.
For context this is how we handle this in AC:
- We intercept requests (in GeckoView:
onLoadRequest()
; in WebView:shouldInterceptRequest()
) - In WebView we can return custom content (WebResourceResponse) for such a request
- In GeckoView we can only return
AllowOrDeny
. For custom content we returnDENY
and callloadData()
-> WebView: Custom content is shown with intercepted URI (e.g. firefox:home
).
-> GeckoView: Custom content is shown with content in data URI (e.g. data:......
).
Comparing this with WebView there are two options: (1) Allowing custom content to be returned for intercepted requests. (2) Allowing loading data with a base URI (which is an option in WebView).
Is any of that possible or is there another way to get custom content for custom URLs working?
(In reply to Sebastian Kaspari (:sebastian; :pocmo) from comment #2)
Is any of that possible or is there another way to get custom content for custom URLs working?
Everything is possible with enough time/money, but it's definitely a non-trivial amount of work to do this.
Comment 4•5 years ago
|
||
The workaround in Focus is that we show those internal pages (like "About rights") in a separate activity without URL bar.
Comment 5•5 years ago
|
||
James says he will take a look.
P1 for FFTV.
Comment 6•5 years ago
|
||
This looks related to bug 1483677 with the corresponding AC issue here.
Comment 7•5 years ago
|
||
Demoting to [gvtv:p2] because Simon implemented a workaround in FFTV in https://github.com/mozilla-mobile/firefox-tv/issues/1824.
He filed FFTV issue https://github.com/mozilla-mobile/firefox-tv/issues/1958 to remove the workaround after this GV bug is fixed.
Comment 8•5 years ago
|
||
I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:
e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9
Updated•5 years ago
|
Comment 9•5 years ago
|
||
This has come up again from external projects that want to call loadData.
One of the recommendations was to write the file to /tmp
and then load it with file://
URIs.
Comment 10•4 years ago
|
||
Demoting to P3 as GVTV is not a priority for the next 12 months at least.
Comment 11•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:amoya, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 12•2 years ago
|
||
Moving some input bugs to the new GeckoView::IME component.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Description
•