maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [Solved] starting microb browser without the bookmarks window (https://talk.maemo.org/showthread.php?t=87977)

impeham 2012-11-23 08:40

[Solved] starting microb browser without the bookmarks window
 
Is there a way to do that from command line?

i cannot even find a way to close this bookmarks window using any command without killing the browser itself - which i find very weird since if i click its X button it does not close the browser.

laasonen 2012-11-23 09:22

Re: starting microb browser without the bookmarks window
 
I don't have a N900, but you could try something like this with wmctrl to make the application think its being closed from the useri nterface:
Code:

wmctrl -c Web

impeham 2012-11-23 09:37

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by laasonen (Post 1297461)
I don't have a N900, but you could try something like this with wmctrl to make the application think its being closed from the useri nterface:
Code:

wmctrl -c Web

i tried it before, but it has the same affect - it closes both windows

reinob 2012-11-23 10:03

Re: starting microb browser without the bookmarks window
 
(EDIT) Ahh.. scratch that: you mean you want to programmatically close the bookmarks window but not the whole browser?

Quote:

Originally Posted by impeham (Post 1297452)
Is there a way to do that from command line?
i cannot even find a way to close this bookmarks window using any command without killing the browser itself - which i find very weird since if i click its X button it does not close the browser.

That's weird. If I open microb, I get the bookmarks window. I click on a bookmark and it opens in a separate window. I then click on "X" on the bookmarks window and that (and only that) window is closed. The opened bookmark is still there and working OK.

Note: I'm on stock PR1.3.1, no CSSU.

laasonen 2012-11-23 10:04

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by impeham (Post 1297462)
i tried it before, but it has the same affect - it closes both windows

Then you are probably going to have to make a script which selects the correct window with it's window identity to avoid closing every single one of them. You can get the list of open windows with this command:
Code:

wmctrl -l

reinob 2012-11-23 10:17

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by laasonen (Post 1297475)
Then you are probably going to have to make a script which selects the correct window with it's window identity to avoid closing every single one of them. You can get the list of open windows with this command:
Code:

wmctrl -l

I tried killing a single browser window with wmctrl -i -c <window id> but it closed all browser windows.

Tofe 2012-11-23 10:49

Re: starting microb browser without the bookmarks window
 
You guys like it the hard way... Why not calling the appropriate dbus method to start a new browser ?

dbus-send --system --type=method_call --dest="com.nokia.osso_browser" --print-reply /com/nokia/osso_browser/request com.nokia.osso_browser.open_new_window string:"about:blank" boolean:false

Et voilą!

impeham 2012-11-23 12:16

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by Tofe (Post 1297500)
You guys like it the hard way... Why not calling the appropriate dbus method to start a new browser ?

dbus-send --system --type=method_call --dest="com.nokia.osso_browser" --print-reply /com/nokia/osso_browser/request com.nokia.osso_browser.open_new_window string:"about:blank" boolean:false

Et voilą!

The problem is that it opens the default browser - in my case Opera, and i want specifically microb to open with my URL for this case.

to make it open the microb browser with the URL you can use:

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

however - this also opens the bookmarks window which is the main issue.

Wikiwide 2012-11-23 15:05

Re: starting microb browser without the bookmarks window
 
1 Attachment(s)
Quick reply...
MicroB can be started as "browser", for instance, in case of "browser --view=box" the window with list of bookmarks is closed as soon as you open anything in browser. That's not to say that this style of browsing will not require stylus and patience.
http://i.imgur.com/RKhhm.png?1?7208
Best wishes.
__________________
Per aspera ad astra...

impeham 2012-11-23 16:51

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by Wikiwide (Post 1297572)
Quick reply...
MicroB can be started as "browser", for instance, in case of "browser --view=box" the window with list of bookmarks is closed as soon as you open anything in browser. That's not to say that this style of browsing will not require stylus and patience.
http://i.imgur.com/RKhhm.png?1?7208
Best wishes.
__________________
Per aspera ad astra...

i don't understand what you're saying - can you give a command example?

Wikiwide 2012-11-23 19:08

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by impeham (Post 1297611)
i don't understand what you're saying - can you give a command example?

In X-Terminal, code:
Code:

browser --view=tab --url="about:mozilla"
will open MicroB with webpage "about:mozilla" loaded. All pages are in tabs within one window.
The screenshot was with:
Code:

browser --view=box --url="about:mozilla"
It's an easier way to to make it open the microb browser with the URL you wish to see, and without the separate bookmarks window opening.

There is also an old discussion, but its dbus command didn't quite work for me.

Also, changing "browser.startup.homepage" in "about:config" seemed to have no effect. Maybe, after restart?

Best wishes...

peterleinchen 2012-11-23 19:43

Re: starting microb browser without the bookmarks window
 
@wikiwide
on which system with which version are you running your --view=box or --view=tab options?

On mine N900 with kp50 and microb-engine 20100401-1.9.2-5.2+0m5 they do not work.

But -and only using- the option --url="site_address" works fine.

laasonen 2012-11-23 19:50

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by reinob (Post 1297483)
I tried killing a single browser window with wmctrl -i -c <window id> but it closed all browser windows.

In that case I'm starting to run out of ideas, but you could try to use xdotool to bring the bookmark window on foreground and click alt+f4.

Code:

ID=`xdotool search --name "Web"`
xdotool windowactivate --sync $ID key --clearmodifiers --delay 100 alt+F4

I'm hoping that works, but I'm not sure, because I can't test. There are three things what might need modification:
  1. Search method/application's name
  2. Time given for the X server to bring the window to foreground
  3. Closing method? Does alt+F4 work? Do we need to use cursor instead?

impeham 2012-11-23 20:22

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by Wikiwide (Post 1297637)
In X-Terminal, code:
Code:

browser --view=tab --url="about:mozilla"
will open MicroB with webpage "about:mozilla" loaded. All pages are in tabs within one window.
The screenshot was with:
Code:

browser --view=box --url="about:mozilla"
It's an easier way to to make it open the microb browser with the URL you wish to see, and without the separate bookmarks window opening.

There is also an old discussion, but its dbus command didn't quite work for me.

Also, changing "browser.startup.homepage" in "about:config" seemed to have no effect. Maybe, after restart?

Best wishes...

for me it starts the default browser - opera - how do i use this specifically for microb?

Wikiwide 2012-11-23 20:43

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by impeham (Post 1297658)
for me it starts the default browser - opera - how do i use this specifically for microb?

Hmf... I don't even know how to change on Maemo 5 which browser is default...
Maemo 5: 21.2011.38 (CSSU Testing)
Ah, code to start normal window with needed URL without seeing bookmarks window (probably doesn't work when MicroB isn't default browser, though):
Code:

/usr/bin/browser_dbuscmd.sh load_url about:mozilla
Actual D-Bus command can be found inside "/usr/bin/browser_dbuscmd.sh", which belongs to package "microb-eal".
Best wishes.

Quote:

Originally Posted by peterleinchen (Post 1297648)
@wikiwide
on which system with which version are you running your --view=box or --view=tab options?

On mine N900 with kp50 and microb-engine 20100401-1.9.2-5.2+0m5 they do not work.

But -and only using- the option --url="site_address" works fine.

What does "browser --help" say? Because my "microb-engine" seems to have exactly the same version, and I have seen these command-line options working before CSSU version of Maemo was installed.
__________________
Per aspera ad astra...

peterleinchen 2012-11-23 21:35

Re: starting microb browser without the bookmarks window
 
@wikiwide
browser --help
just opens the bookmark window without leaving any message in x-term.

Defining default browser on Maemo is easily done via package 'browser-switchboard'.

If your commands would work it would be smth like
microb --url="about:mozilla"
(but this also opens the bookmark window)

Wikiwide 2012-11-23 22:00

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by peterleinchen (Post 1297687)
@wikiwide
(but this also opens the bookmark window)

What about, in X-Terminal?
Code:

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:"about:mozilla"
Best wishes.

peterleinchen 2012-11-23 22:38

Re: starting microb browser without the bookmarks window
 
Yep, this (of course) works.
But it opens Opera when Opera is the default browser, so not what the OP is asking for ...

laasonen 2012-11-24 13:52

Re: starting microb browser without the bookmarks window
 
I took a fast look at browser-switchboard's source code and it looks like it replaces microb's dbus service and uses maemo-invoker to open microb when needed.

Something like this might work, if you are lucky:
Code:

/usr/bin/maemo-invoker browser
wmctrl -c Web
/usr/bin/maemo-invoker browser --url http://google.fi

Sure way would be to:
  1. Replace browser-switchboard's dbus-service with microb's dbus service
  2. Close all microb windows, if bookmark window opens
  3. Open webpage via dbus
  4. Replace microb's dbus-service with browser-switchboard's dbus service

impeham 2012-11-25 08:46

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by laasonen (Post 1297878)
I took a fast look at browser-switchboard's source code and it looks like it replaces microb's dbus service and uses maemo-invoker to open microb when needed.

Something like this might work, if you are lucky:
Code:

/usr/bin/maemo-invoker browser
wmctrl -c Web
/usr/bin/maemo-invoker browser --url http://google.fi

Sure way would be to:
  1. Replace browser-switchboard's dbus-service with microb's dbus service
  2. Close all microb windows, if bookmark window opens
  3. Open webpage via dbus
  4. Replace microb's dbus-service with browser-switchboard's dbus service

Interesting idea - i'll try it thanks :)

anahuj 2012-11-29 03:50

Re: starting microb browser without the bookmarks window
 
BTW: Sometimes desktop links opens the bookmarks window,
sometimes not. Strange.

So, how to disable the appearance of the bookmarks
window when opening desktop links?

My N900's problem is that the bookmarks window
jams the browsing badly. Even if I immediately
close the bookmarks window, the browsing is
jammed. When bookmarks window does not
come up, browsing works ok.

More strange happens: it takes 9 minutes to open
a webpage via the bookmarks window. Thus
I prefer the desktop links.

But then the desktop links may cause more problems:

Only four desktops, so many links. No ability to
organize the links: say, by labeling and grouping
desktop areas.

Perhaps because I have so many links, the system
menus are starting to show as black: menu entries
are invisible. Likewise the character dialog.
The desktop links and app icons are many times
invisible too. The toolbar bitmap is showing
wrong bitmaps: like the clock is replaced by
bitmap taken from some other part of display.

Switching to other browsers is no because
Firefox Mobile and Opera are some kind of jokes
compared to the Web in usability.
(And I have advice: when hardware is limited,
the browser should be more cabable, not
reduced like Firefox Mobile.)

Wikiwide 2012-11-29 12:51

Re: starting microb browser without the bookmarks window
 
Quote:

Originally Posted by anahuj (Post 1299560)
BTW: Sometimes desktop links opens the bookmarks window, sometimes not. Strange.

Strange. But then, I don't know much about them, I don't use them.
Quote:

Originally Posted by anahuj (Post 1299560)
So, how to disable the appearance of the bookmarks window when opening desktop links?

Theoretically, startup page could be disabled, or, at least, changed, in "about:config". However, it seems to be useless: I have not seen any sign of this setting being used by the browser.
Did you know how many packages are connected to default browser, in one way or another? microb-eal, microb-engine, microb-engine-common, tablet-browser-ui, tablet-bookmark-manager, and many others. Searching for bookmark window is a nightmare.
Quote:

Originally Posted by anahuj (Post 1299560)
My N900's problem is that the bookmarks window jams the browsing badly. Even if I immediately close the bookmarks window, the browsing is jammed. When bookmarks window does not come up, browsing works ok.

So, we need to find the bookmark-list-window and figure out how to make it work faster.
Quote:

Originally Posted by anahuj (Post 1299560)
More strange happens: it takes 9 minutes to open a webpage via the bookmarks window. Thus I prefer the desktop links.

For me, MicroB is broken. I don't know why, but I cannot even open GMail in it. Most of the time, "not redirecting properly"...
Quote:

Originally Posted by anahuj (Post 1299560)
But then the desktop links may cause more problems:

Only four desktops, so many links. No ability to organize the links: say, by labelling and grouping desktop areas.

Perhaps because I have so many links, the system menus are starting to show as black: menu entries are invisible. Likewise the character dialog. The desktop links and app icons are many times invisible too. The toolbar bitmap is showing wrong bitmaps: like the clock is replaced by bitmap taken from some other part of display.

So, you need to make your own simple HTML page with all your bookmarks, and then start MicroB with this page and without list of bookmarks.
Oh, and I thank Sentinel1705 for tip: there is a small config file at "/home/user/.browser".
And there are MicroB tweaks.
And who knew that MicroB renders not only nokia maps, but also chat conversation and SMS conversation, if rtcom-messaging-ui is to be believed?
Quote:

Originally Posted by anahuj (Post 1299560)
Switching to other browsers is no because Firefox Mobile and Opera are some kind of jokes compared to the Web in usability. (And I have advice: when hardware is limited, the browser should be more capable, not reduced like Firefox Mobile.)

If you want a desktop-like browser, look for chromium on Maemo 5; I still have it installed, though I mostly use Fennec 16 (17 could not install correctly, for some reason; 18 will be ported shortly, and promises speed improvements).
Since you prefer to use MicroB as default, this should work for you:
Code:

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:"about:mozilla"
Just create a shortcut which would execute the code, and put URL to you hand-made list of favourites into the code; then the shortcut will start MicroB without bookmark window and with list of links to your favourite pages.
Best wishes.
__________________
Per aspera ad astra...

impeham 2012-11-30 21:26

Re: starting microb browser without the bookmarks window
 
The final tested working solution for this issue is the following script which will open the url from parameter 1 with a single maemo browser window:


#!/bin/sh

current=$(browser-switchboard-config -b)
browser-switchboard-config -s -b "microb"
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:"$1"
sleep 5
browser-switchboard-config -s -b "$current"


All times are GMT. The time now is 00:21.

vBulletin® Version 3.8.8