Bug 235045

Summary: [Cocoa] Inspector Extensions: tabIconURLs with custom scheme URLs are incorrectly loaded
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, darin, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, pangle, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch v1.0
none
Patch v1.1 none

Description BJ Burg 2022-01-10 12:48:23 PST
It looks like the conversion from NSURL -> API::URL -> WTF::URL -> WTF::String -> JSValue is not going as expected.

Since we don't examine or modify the URL, it suffices to convert it to NSURL -> WTF::String -> JSValue.
Comment 1 Radar WebKit Bug Importer 2022-01-10 12:48:48 PST
<rdar://problem/87357027>
Comment 2 BJ Burg 2022-01-10 12:52:59 PST
Created attachment 448788 [details]
Patch v1.0
Comment 3 Devin Rousso 2022-01-10 13:32:21 PST
(In reply to BJ Burg from comment #0)
> It looks like the conversion from NSURL -> API::URL -> WTF::URL -> WTF::String -> JSValue is not going as expected.
This seems like a bug, no?  Or is this expected?
Comment 4 BJ Burg 2022-01-10 14:41:00 PST
Created attachment 448802 [details]
Patch v1.1
Comment 5 Darin Adler 2022-01-10 15:04:18 PST
Comment on attachment 448802 [details]
Patch v1.1

Looks good.

Please note that using the URL class’s relative URL resolution doesn’t necessarily handle all the edge cases correctly and functions like Document::completeURL end up having to add special cases. So please think further on that point, for things like empty string.
Comment 6 BJ Burg 2022-01-11 13:50:47 PST
(In reply to Darin Adler from comment #5)
> Comment on attachment 448802 [details]
> Patch v1.1
> 
> Looks good.
> 
> Please note that using the URL class’s relative URL resolution doesn’t
> necessarily handle all the edge cases correctly and functions like
> Document::completeURL end up having to add special cases. So please think
> further on that point, for things like empty string.

Good point. In this case the code that provides the NSURL via ensures that the URL is non-nil and is not the empty string.
Comment 7 BJ Burg 2022-01-11 13:51:15 PST
Comment on attachment 448802 [details]
Patch v1.1

ios-wk2 and wincairo failures look to be infrastructure issues.
Comment 8 EWS 2022-01-11 13:58:25 PST
Committed r287895 (245933@main): <https://commits.webkit.org/245933@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448802 [details].