[webkit-help] Javascript Core Extensions

Alexander Shulgin alexander.shulgin at yessoftware.com
Fri Dec 24 03:56:21 PST 2010


On 24.12.2010 13:52, Nimish Nayak wrote:
> Hi
>
> Thanks demallien it cleared my doubt.
>
> @Alexander Shulgin
>
>  >> 2) Using the IWebFrame Interface, loadHTMLString function we can load
>  >> the HTML string when the WinLauncher App starts. But I would like to
>  >> give the location of the File from the local Disk How to achieve this
>  >
>  >Just use loadRequest method with UrlRequest object intialized with
> file:// URL.
>
> Ok There is a function which does exactly the same in the same
> WebLauncher.cpp file here is the function definition >>
> http://pastebin.ca/2027996. But even if the function gets called
> properly it still does not render anything I am calling this function as
> loadURL(SysAllocString(TEXT("C:\\index.html")););

That doesn't really look like file:// URL.  It should be spelled 
"file:///c:/index.html".

>  >> 3)I have observed that an alert on a JS page does not get called. which
>  >> is quite weird. Is this a bug? How to enable the alerts so that if
>  >> someone on the page goes alert("hi"); it would actually
>  >> alert like firefox and Safari
>  >
>  > Showing actual alert messageboxes is delegated to application for
>  > customization purposes.  Just implement the IWebUIDelegate::
>  > runJavaScriptAlertPanelWithMessage() method and be sure set the UI
> delegate.
>
> This really did not work.. and used to bug out all the time .. i
> declared an object of IWebUIDelegate and i called its method as u
> suggested but it did not work. Maybe I did not properly understood what
> u meant. (eg:- set the UI delegate);

Inherit some COM object from IWebUIDelegate, implement the interface and 
put MessageBox call in the mentioned method.  Next call 
IWebView::setUIDelegate() passing the above UI delegate object.  When a 
javascript alert occurs, webkit will see if it has the UI delegate set 
and if so, will call it's runJavaScriptAlertPanelWithMessage() method.

--
Alex


More information about the webkit-help mailing list