Proper Way To Call Browser (Fremantle)

Proper Way To Call Browser (Fremantle)

Brent Chiodo
Karma: 508
2009-09-06 18:42 UTC
I am writing an application for Maemo 5/Fremantle that needs to load the
browser to a specific page when needed. How would I go about calling the
browser?

Ideally, I want to open the browser in a new window to a specific page and
in the current browser process if there is already one open.

Thanks.

--
Best Regards,

Brent Chiodo

  •  Reply

Re: Proper Way To Call Browser (Fremantle)

daniel wilms
Karma: 597
2009-09-07 06:59 UTC
Hi,

the browser can be opened by using a dbus-service. The package is called
"tablet-browser-interface" and you find the header in the dev-package.
Here is an example how to call the service from the command line:

dbus-send --system --type=method_call --dest="com.nokia.osso_browser"
--print-reply /com/nokia/osso_browser/request
com.nokia.osso_browser.load_url string:"http://www.google.com"

Cheers Daniel

ext Brent Chiodo wrote:
> I am writing an application for Maemo 5/Fremantle that needs to load
> the browser to a specific page when needed. How would I go about
> calling the browser?
>
> Ideally, I want to open the browser in a new window to a specific page
> and in the current browser process if there is already one open.
>
> Thanks.
>
> --
> Best Regards,
>
> Brent Chiodo

  •  Reply

Re: Proper Way To Call Browser (Fremantle)

Andrew Flegg
Karma: 3343
2009-09-07 08:06 UTC
On Mon, Sep 7, 2009 at 07:59, daniel wilms<daniel.wilms@nokia.com> wrote:
>
> the browser can be opened by using a dbus-service. The package is called
> "tablet-browser-interface" and you find the header in the dev-package.

I also tested `browser --url=http://www.google.com' and that worked as
well. I suspect the D-Bus approach is better, though?

Cheers,

--
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org/
Maemo Community Council chair
  •  Reply

Re: Proper Way To Call Browser (Fremantle)

David Greaves
Karma: 715
2009-09-07 08:09 UTC
> ext Brent Chiodo wrote:
>> Ideally, I want to open the browser in a new window to a specific page
>> and in the current browser process if there is already one open.

daniel wilms wrote:
> the browser can be opened by using a dbus-service. The package is called
> "tablet-browser-interface" and you find the header in the dev-package.
> Here is an example how to call the service from the command line:
>
> dbus-send --system --type=method_call --dest="com.nokia.osso_browser"
> --print-reply /com/nokia/osso_browser/request
> com.nokia.osso_browser.load_url string:"http://www.google.com"
>

Brent, try this too - it shows usage of the interface daniel refers to.

http://blogs.gnome.org/tthurman/2009/09/03/writing-apps-for-the-n900-part-1/

I assume C - I'm doing something similar in python later too

David

--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."
  •  Reply

Re: Proper Way To Call Browser (Fremantle)

Brent Chiodo
Karma: 508
2009-09-07 15:54 UTC
@Daniel:

Thank you for the info. The interface appears to be roughly the same as
Maemo 4.

@Andrew:

Don't know about Fremantle, but on Diablo browser --url="*" opens a new
browser process instead of using the current one (if there is one).

@David:

I look forward to the one in Python (I program in Python, don't know much
C)!


--
Best Regards,

Brent Chiodo

  •  Reply

Re: Proper Way To Call Browser (Fremantle)

Thomas Perl
Karma: 2689
2009-09-07 16:10 UTC
2009/9/7 Brent Chiodo <bchiodo@gmail.com>:
> I look forward to the one in Python (I program in Python, don't know much C)!

It's not the "perfect" solution, but it works both on Maemo and on the Desktop:

import webbrowser
webbrowser.open_new('http://www.maemo.org/')

See http://docs.python.org/library/webbrowser.html for more information.

HTH

Thomas
  •  Reply

Re: Proper Way To Call Browser (Fremantle)

Brent Chiodo
Karma: 508
2009-10-19 15:29 UTC
Sorry to revive this old thread, but I'm having a problem with using
that dbus service call. When I try it in the SDK I get:

[sbox-FREMANTLE_X86: ~] > dbus-send --system --type=method_call
--dest="com.nokia.osso_browser" --print-reply
/com/nokia/osso_browser/request com.nokia.osso_browser.load_url
string:"google.com"
Error org.freedesktop.DBus.Error.ServiceUnknown: The name
com.nokia.osso_browser was not provided by any .service files

But if I open the browser first, then try it, it works fine.

SDK or platform bug? What gives?

Thanks.


On Mon, Sep 7, 2009 at 2:59 AM, daniel wilms <daniel.wilms@nokia.com> wrote:
> Hi,
>
> the browser can be opened by using a dbus-service. The package is called
> "tablet-browser-interface" and you find the header in the dev-package. Here
> is an example how to call the service from the command line:
>
> dbus-send --system --type=method_call --dest="com.nokia.osso_browser"
> --print-reply /com/nokia/osso_browser/request
> com.nokia.osso_browser.load_url string:"http://www.google.com"
>
> Cheers Daniel
>
> ext Brent Chiodo wrote:
>>
>> I am writing an application for Maemo 5/Fremantle that needs to load the
>> browser to a specific page when needed. How would I go about calling the
>> browser?
>>
>> Ideally, I want to open the browser in a new window to a specific page and
>> in the current browser process if there is already one open.
>>
>> Thanks.
>>
>> --
>> Best Regards,
>>
>> Brent Chiodo
>
>



--
Best Regards,

Brent Chiodo
  •  Reply