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
Trusted Contributor
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860
Accepted Solution

Code for Check the Browser History And Name

Hi All,

Is there any code for the check the number of Browser history is available.
And I want to get the Name or link of the page From Browser History.

I want to check if the link is available in the Browser History, so that I extract that link from Browser History for Webworks Smartphone.

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Trusted Contributor
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Code for Check the Browser History And Name

Can Any One Help me to find the solution of the above problem!!!!!

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

Re: Code for Check the Browser History And Name

HI Nitish,

 

you can check "window.history.length" for history count.

 

var historyCount= window.history.length;


-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

Re: Code for Check the Browser History And Name

check this link for History related function.

 

http://www.java2s.com/Code/JavaScript/Window-Browser/History.htm

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Trusted Contributor
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Code for Check the Browser History And Name

Thanks BrajeshSanodiya for your reply.
I have got through the link provided by you.

But my problem is when I restart my App.
It is showing the "window.history.length" is 1 only.
I think the Device clean the history if I close the App.

Is there any way to save the Browser History and extract from the History. 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Code for Check the Browser History And Name

History is based on session so it will be available only as long as the app is running. Accessing the history isn't really possible, you can get the history.length, or use history['0'] to get an entry, but in most browsers the last one will not work due to browser security.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.