Bug 115561

Summary: Web Inspector: WK1 implementation of InspectorFrontendHost.save() triggers script error
Product: WebKit Reporter: Brian Burg <burg>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.8   

Description Brian Burg 2013-05-03 11:37:39 PDT
Running from Mac MiniBrowser's inspector console:

InspectorFrontendHost.save("file:///~/Desktop/foo.txt", "test", true)

will cause the following error:

TypeError: 'undefined' is not a function (evaluating 'InspectorFrontendAPI.savedURL("file://localhost/Users/burg/Desktop/foo.txt ")')

This is called from WebInspectorFrontendClient::save (in WebCoreSupport/WebInspectorClient.mm). It was introduced in https://bugs.webkit.org/show_bug.cgi?id=105547.

It seems like the InspectorFrontendAPI.savedURL function is not being exposed to script, or the savedURL callback is being executed in the wrong script context.
Comment 1 Timothy Hatcher 2013-05-03 13:19:17 PDT
Looks like we need to implement InspectorFrontendAPI.savedURL this on the Safari front end. 

I'll add InspectorFrontendAPI.savedURL and InspectorFrontendAPI.appendedToURL as stubs.
Comment 2 Timothy Hatcher 2013-05-03 13:26:26 PDT
(I assume you were using Safari's Web Inspector?)
Comment 3 Brian Burg 2013-05-03 13:43:36 PDT
Yes, it was using the Safari web inspector, from about a day ago.
Comment 4 Timothy Hatcher 2013-05-03 13:44:48 PDT
I'll push a fix in the nightly soon.
Comment 5 Radar WebKit Bug Importer 2013-05-03 13:45:05 PDT
<rdar://problem/13806055>
Comment 6 Timothy Hatcher 2013-05-05 17:26:20 PDT
This is fixed. It should be in the nightly now or the next build.