Hi there,

On Thu, 2009-09-03 at 10:13 +0800, chengbo wrote:
> Hi guys :
> 
> When useing nsIIOService interface  to set offline in moblin
> mhs-service . 
> 
> But it does not work.

What do you expect to happen here? If you call this in mhs-service, all
that would stop happening in terms of network io would be favicon
fetching. You need to run this code in a component in either
moblin-web-browser or clutter-mozembed (i.e. the rendering side) if you
want it to affect the browser.

> Following  code about  set offline:
>         
>    nsresult rv;
>    nsCOMPtr<nsIIOService> mIOService = do_GetIOService(&rv);
>    mIOService->SetOffline(PR_TRUE);
>  
> Following  code is set javascript :
> 
> 
>   nsCOMPtr<nsIPrefService> pref_service
>     = do_GetService (NS_PREFSERVICE_CONTRACTID, &rv);
> 
> pref_service->SetBoolPref("javascript.enable",PR_FALSE);
> 
> 
> But offline and javascript functions still can not work .

If you set javascript.enable to PR_FALSE, JavaScript functions will
*not* work: http://kb.mozillazine.org/Javascript.enabled

> Maybe offline or javascript has be removed from xulrunner-headless?

I can assure you javascript works in xulrunner-headless; you'd notice if
it didn't :) Some of the Moblin web browser components are written in
JavaScript too.

As for setting offline/online, I'm afraid I don't really know about this
or if it would work or not. If the call returns a success code though,
and there are no exceptions on the terminal, it should work.

Just bear in mind that mhs-service only handles parts of the framework
that won't work from multiple processes (so currently, history,
preferences, cookie storage, bookmarks and favicon fetching). Everything
else is either in clutter-mozembed, moblin-web-browser or the backend
itself.

Hope that helps,

--Chris


_______________________________________________
Moblin dev Mailing List
[email protected]

To manage or unsubscribe from this mailing list visit:
http://lists.moblin.org/listinfo/dev or your user account on http://moblin.org 
once logged in.

For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists

Reply via email to