Bug 156184

Summary: [wincairo] web inspector failed to launch in MiniBrowser
Product: WebKit Reporter: Bill Ming <mbbill>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, Hironori.Fujii, joepeck, mattbaker, nvasilyev
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
bburg: review+, joepeck: commit-queue-
Patch none

Description Bill Ming 2016-04-04 15:25:09 PDT
When launching web inspector within MiniBrowser, an error shows up saying "Web Inspector encountered an internal error"
The reason of this issue is that, universal access to file url is set to false so that an exception will be throw when inspector trying to access localstorage.
Set it to true solves this problem. Mac porting of Minibrowser also sets it to true btw.
Comment 1 Radar WebKit Bug Importer 2016-04-04 15:25:46 PDT
<rdar://problem/25539297>
Comment 2 Bill Ming 2016-04-04 15:32:07 PDT
Created attachment 275581 [details]
Patch
Comment 3 BJ Burg 2016-04-04 15:46:10 PDT
Comment on attachment 275581 [details]
Patch

rs=me

Note: in the future, we want to move off file:// URLs and use a custom scheme so the inspector process needs fewer sandbox entitlements.
Comment 4 Bill Ming 2016-04-07 01:04:56 PDT
Thanks. If that happens someday, I hope I could help on that.
Comment 5 Bill Ming 2016-04-14 05:03:41 PDT
So, is it good to merge?
Comment 6 Fujii Hironori 2016-04-26 20:30:10 PDT
Bill,

You did not set commit-queue:? flag.

https://webkit.org/contributing-code/#optional-use-of-the-webkit-commit-bot
Comment 7 Joseph Pecoraro 2016-05-04 11:00:13 PDT
Comment on attachment 275581 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=275581&action=review

> Tools/MiniBrowser/win/MiniBrowser.cpp:199
> -    m_prefsPrivate->setAllowUniversalAccessFromFileURLs(FALSE);
> +    m_prefsPrivate->setAllowUniversalAccessFromFileURLs(TRUE);

Errr, why is MiniBrowser be setting this preference? I think it should be the Web Inspector on Windows that should be setting it. Is this a WebKit1 window, or WebKit2?
Comment 8 Joseph Pecoraro 2016-05-04 11:06:04 PDT
Comment on attachment 275581 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=275581&action=review

>> Tools/MiniBrowser/win/MiniBrowser.cpp:199
>> +    m_prefsPrivate->setAllowUniversalAccessFromFileURLs(TRUE);
> 
> Errr, why is MiniBrowser be setting this preference? I think it should be the Web Inspector on Windows that should be setting it. Is this a WebKit1 window, or WebKit2?

If this is WebKit1 could this preference be set in:
Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp - WebInspectorClient::openLocalFrontend

If this is WebKit2, other ports set this in their inspector page configuration in:
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm - WebInspectorProxy::platformCreateInspectorPage
Source/WebKit2/UIProcess/mac/WebInspectorProxyEfl.cpp - WebInspectorProxy::platformCreateInspectorPage

Perhaps this should be added to other ports (gtk) as well. cq- while the question gets answered.
Comment 9 Fujii Hironori 2016-05-08 23:30:54 PDT
Thank you for review.
WebKit1 Mac port has following code in
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:

>    [preferences setAllowFileAccessFromFileURLs:YES];
>    [preferences setAllowUniversalAccessFromFileURLs:YES];
Comment 10 Fujii Hironori 2016-05-08 23:33:17 PDT
Created attachment 278387 [details]
Patch
Comment 11 WebKit Commit Bot 2016-05-09 09:27:52 PDT
Comment on attachment 278387 [details]
Patch

Clearing flags on attachment: 278387

Committed r200577: <http://trac.webkit.org/changeset/200577>
Comment 12 Joseph Pecoraro 2016-05-09 13:41:38 PDT
Nice! Thanks for re-addressing this!