I need to disable a toolbar button when there is no page to go back in history object. Similar to the browser back button.
How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use
tabbrowser.sessionHistoryproperty:Your listener should check whether
gBrowser.sessionHistory.indexis 0 (nothing to go back) and setbutton.disabledproperty appropriately.Either that or you simply make your button observe the browser’s back button using
<observes>tag:This makes sure that the
disabledattribute for your button is copied over from theBrowser:Backcommand.