If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

NEW
Unassigned

Status

()

Firefox for Android
Favicon Handling
3 years ago
2 years ago

People

(Reporter: bc, Unassigned)

Tracking

Trunk
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
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?
(Reporter)

Updated

3 years ago
Flags: needinfo?(snorp)
(Reporter)

Comment 1

3 years ago
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.
(Reporter)

Comment 4

3 years ago
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)
You need to log in before you can comment on or make changes to this bug.