Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
araskin
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others
Accepted Solution

Closing browser page on Exit

Is there a way, via JavaScript to close a page that is being viewed on a BB? I know that this can be done in IE, etc but not sure if the BB Browser support this.
BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Closing browser page on Exit

Yes, you can use the JavaScript method window.close to close the BlackBerry Browser.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
ashihs_k
Posts: 31
Registered: ‎09-24-2008
My Device: Not Specified

Re: Closing browser page on Exit

Hi,

 

Blackberry browser does not close via window.close()

window.close() closed the active window and activate the previous window from history.

 

i want to close the browser not just active window.

if u got the solution then plz help me.

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Closing browser page on Exit

The browser will "close" to the bookmarks screen if the JavaScript close method is called and there is no previous history.  Otherwise, the previous page in history is shown.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
araskin
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others

Re: Closing browser page on Exit

Thats right Mark. That is what I found too.


it would be nice if Close actually closed the browser and not closed it unless there is a previous page. :-)

 

Alon

New Developer
vinayakk
Posts: 20
Registered: ‎12-27-2009
My Device: Not Specified

Re: Closing browser page on Exit [Urgent]

Hello Mark,

 

I am working on v4.5 browser and I am facing the same issue of exiting the browser window. My application navigates through some HTML pages and when the user tries to exit the browser, it just closes the current page and displays the previous page as per browser history stack.

 

As with desktop browsers, I assumed that window.close() method shall terminate the browser application, but in blackberry's case it just closes the current page and takes you to the 'back' page. I read about this in blackberry docs. But my requirement is to close the browser application on exit instead of redirecting to previous URL....

 

What options/workaround would you suggest me please ?

As ever,
Vinayak Kadam
New Developer
pdale
Posts: 6
Registered: ‎02-11-2010
My Device: Blackberry 9000

Re: Closing browser page on Exit [Urgent]

Yes I have the exact same requirement to be able to close the browser app from a page. In my scenario I amrunning a custom java app built using the blackberry APIs - from my code I start the browser but would like to close it and return to my app via a close button - is this possible?? cant see any obvious way doing this..

Visitor
pankaj_n
Posts: 1
Registered: ‎08-19-2010
My Device: Not Specified

Re: Closing browser page on Exit [Urgent]

same problem here. window.close() take to last visited page from history. Did you find any work around for this problem.

New Developer
vinayakk
Posts: 20
Registered: ‎12-27-2009
My Device: Not Specified

Re: Closing browser page on Exit [Urgent]

[ Edited ]

Actually I stopped my R&D in it for some reasons. Just post a new thread so that it will be actually viewed and chances of responses would maximize.

 

As ever,
Vinayak Kadam