RESOLVED FIXED 117927
Web Inspector: WebInspector.displayNameForURL() failure prevents DOM inspection
https://bugs.webkit.org/show_bug.cgi?id=117927
Summary Web Inspector: WebInspector.displayNameForURL() failure prevents DOM inspection
Antoine Quint
Reported 2013-06-24 03:02:37 PDT
If I go to http://www.lequipe.fr/Football/Actualites/Menez-attend-un-signe/380997#xtor=RSS-1, I can't inspect the page due to the following failure: [Error] URIError: URI error displayNameForURL (Main.js, line 2894) _updateTitles (Main.js, line 2895) _updateResource (Main.js, line 2893) ResourceTreeElement (Main.js, line 2876) _addTreeElementForRepresentedObject (Main.js, line 3014) onpopulate (Main.js, line 2980) expand (Main.js, line 2405) _attach (Main.js, line 2364) insertChild (Main.js, line 2230) _mainFrameDidChange (Main.js, line 2743) dispatch (Main.js, line 278) dispatchEventToListeners (Main.js, line 280) _mainFrameDidChange (Main.js, line 1514) _processMainFrameResourceTreePayload (Main.js, line 1500) (anonymous function) dispatch (Main.js, line 388) dispatchNextQueuedMessageFromBackend (Main.js, line 8396) (anonymous function)
Attachments
Patch (1.70 KB, patch)
2013-06-24 06:09 PDT, Antoine Quint
no flags
Patch for landing (1.72 KB, patch)
2013-06-24 06:18 PDT, Antoine Quint
no flags
Radar WebKit Bug Importer
Comment 1 2013-06-24 03:02:55 PDT
Antoine Quint
Comment 2 2013-06-24 03:30:05 PDT
The error is coming from calling decodeURIComponent() with this string as the value for urlComponents.lastPathComponent: http://ww84.smartadserver.com/call2/pubjallajax/2368/17167/2077,2078,647,2163,7186,7185,630,713,650,1278,7186,631,3075,4738,736,632,12340,1075,1446,651,648,16752/4891911503/xtor%3DRSS-1%3Bsize%3Dsmall%3BFOOTBALL%3BLIGUE_1%3BSAISON_2012-2013%3BPARIS-SG%3BMENEZ_JEREMY%3BTRANSFERTS_FOOTBALL%3BMERCATO_ETE_2013%3BINFO_L_%C9QUIPE%3BD1%3B? xtor%3DRSS-1%3Bsize%3Dsmall%3BFOOTBALL%3BLIGUE_1%3BSAISON_2012-2013%3BPARIS-SG%3BMENEZ_JEREMY%3BTRANSFERTS_FOOTBALL%3BMERCATO_ETE_2013%3BINFO_L_%C9QUIPE%3BD1%3B
Antoine Quint
Comment 3 2013-06-24 05:49:32 PDT
It looks like urlComponents.lastPathComponent is just set incorrectly.
Antoine Quint
Comment 4 2013-06-24 05:53:41 PDT
The problematic string passed todecodeURIComponent() is actually "xtor%3DRSS-1%3Bsize%3Dsmall%3BFOOTBALL%3BLIGUE_1%3BSAISON_2012-2013%3BPARIS-SG%3BMENEZ_JEREMY%3BTRANSFERTS_FOOTBALL%3BMERCATO_ETE_2013%3BINFO_L_%C9QUIPE%3BD1%3B"
Antoine Quint
Comment 5 2013-06-24 05:57:07 PDT
"%C9" is the part of the string that yields the decodeURIComponent exception.
Antoine Quint
Comment 6 2013-06-24 06:03:33 PDT
Looks like the URI encoding is incorrect, and "É" should be "%C3%89" and not "%C9", although some pages on the internets seem to suggest that's OK (http://www.degraeve.com/reference/urlencoding.php). But the RFC 3986 (http://tools.ietf.org/html/rfc3986) suggests otherwise (first full paragraph of page 16). We should just handle the possible exception thrown by decodeURIComponent() here.
Antoine Quint
Comment 7 2013-06-24 06:09:34 PDT
Timothy Hatcher
Comment 8 2013-06-24 06:15:28 PDT
Comment on attachment 205288 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=205288&action=review We should probably guard WebInspector.updateWindowTitle and parseQueryString too. > Source/WebInspectorUI/UserInterface/Main.js:360 > + displayName = decodeURIComponent(urlComponents.lastPathComponent || ""); > + } catch (e) { > + // Ignore possible URIError. We should fallback to urlComponents.lastPathComponent (not decoded) for displayName in the catch.
Antoine Quint
Comment 9 2013-06-24 06:18:35 PDT
Created attachment 205289 [details] Patch for landing
WebKit Commit Bot
Comment 10 2013-06-24 11:06:52 PDT
Comment on attachment 205289 [details] Patch for landing Clearing flags on attachment: 205289 Committed r151918: <http://trac.webkit.org/changeset/151918>
WebKit Commit Bot
Comment 11 2013-06-24 11:06:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.