Closed Bug 1104174 Opened 10 years ago Closed 3 years ago

java.net.URISyntaxException loading data:text/html,... url

Categories

(Firefox for Android Graveyard :: Favicon Handling, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bc, Unassigned)

References

Details

Loading the mochitests in Samsung Galaxy S3 running 4.0.4 I get:

java.net.URISyntaxException: Illegal character in scheme specific part at index 15: data:text/html,<script>window.onload%20=%20function()%20{%20opener.continueTest();%20}</script>

index 15 corresponds to the , in the data url. Snorp, Is this something we can fix?
Flags: needinfo?(snorp)
fwiw, I can enter a data:text/html,hello url manually both in the native browser and fennec.

This appears to be favicon related. An example exception stack is:

E/GeckoFavicons( 3008): URISyntaxException getting default favicon URL
E/GeckoFavicons( 3008): java.net.URISyntaxException: Illegal character in scheme specific part at index 15: data:text/html,<script>window.onload%20=%20function()%20{%20opener.continueTest();%20}</script>
E/GeckoFavicons( 3008): 	at libcore.net.UriCodec.validate(UriCodec.java:63)
E/GeckoFavicons( 3008): 	at java.net.URI.parseURI(URI.java:373)
E/GeckoFavicons( 3008): 	at java.net.URI.<init>(URI.java:204)
E/GeckoFavicons( 3008): 	at org.mozilla.gecko.favicons.Favicons.guessDefaultFaviconURL(Favicons.java:532)
E/GeckoFavicons( 3008): 	at org.mozilla.gecko.favicons.Favicons.getSizedFavicon(Favicons.java:213)
E/GeckoFavicons( 3008): 	at org.mozilla.gecko.Tab.loadFavicon(Tab.java:416)
E/GeckoFavicons( 3008): 	at org.mozilla.gecko.BrowserApp.onTabChanged(BrowserApp.java:311)
E/GeckoFavicons( 3008): 	at org.mozilla.gecko.Tabs$5.run(Tabs.java:615)
E/GeckoFavicons( 3008): 	at android.os.Handler.handleCallback(Handler.java:605)
E/GeckoFavicons( 3008): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/GeckoFavicons( 3008): 	at android.os.Looper.loop(Looper.java:137)
E/GeckoFavicons( 3008): 	at android.app.ActivityThread.main(ActivityThread.java:4514)
E/GeckoFavicons( 3008): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoFavicons( 3008): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/GeckoFavicons( 3008): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
E/GeckoFavicons( 3008): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
E/GeckoFavicons( 3008): 	at dalvik.system.NativeStart.main(Native Method)
This is a really old bug. Java's URI class is stricter than it should be. We try to parse the URI so we can guess a favicon URI, and we get this error.
Component: General → Favicon Handling
Hardware: ARM → All
I assume we catch the exception and print it out in the Log. Let's stop doing that if:
1. We have no intention of fixing anything
2. It does not really break the behavior
3. The exception out in the log causes grief for our Log parsing tools.
http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/favicons/Favicons.java?from=Favicons.java#521

does catch the exception. I thought this was causing the mochitests to fail to complete but I guess that is not the case. I don't care about the logging so much.
Flags: needinfo?(snorp)
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.