[webkit-help] How to enable Web Inspector in winlauncher

Adam Roben aroben at apple.com
Tue Aug 16 05:52:11 PDT 2011


On Aug 16, 2011, at 2:06 AM, Sumedh wrote:

> 
> >>1) We are using winlauncher project with webkit (apple port). We want something to debug html as well as javascript. Web inspector is not working for us. Is there any flag that i need to set while building webkit to enable inspector element.
> 
> >You need to turn on the "developer extras" preference. You can do this by calling IWebPreferencesPrivate::
> setDeveloperExtrasEnabled(TRUE).
> 
> Here is the code in which we are setting DeveloperExtrasEnabled to true. Are we taking right approach. 
> 
>     IWebPreferences* tmpPreferences = 0;
>     IWebPreferences* standardPreferences = 0;
> 
>     if (FAILED(WebKitCreateInstance(CLSID_WebPreferences, 0, IID_IWebPreferences, reinterpret_cast<void**>(&tmpPreferences))))
>         goto exit;
> 
>     if (FAILED(tmpPreferences->standardPreferences(&standardPreferences)))
>         goto exit;
>     
>     standardPreferences->setAcceleratedCompositingEnabled(TRUE);
> 
> 
>     hr = standardPreferences->QueryInterface(IID_IWebPreferencesPrivate, reinterpret_cast<void**>(&prefernceprivate));
>     if (FAILED(hr))
>        goto exit;
> 
>     
>     prefernceprivate->setDeveloperExtrasEnabled(TRUE);        
> 
>     prefernceprivate->developerExtrasEnabled(&bln);    
> 
>     hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, (void**)&lWebView);
>     if (FAILED(hr))
>         goto exit;

Yes, this looks right to me.

> Still,we can not get web inspect element when i click on it.
> 
> NOTE: I am using webkit.dll from the nightly builds.

I'd suggest stepping through WebView::notifyPreferencesChanged (where the developer extras preference is passed down to WebCore) and WebCore::ContextMenuController::showContextMenu (where the Inspect Element item is added) as a start.

-Adam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20110816/333eb65a/attachment.html>


More information about the webkit-help mailing list