cancel
Showing results for 
Search instead for 
Did you mean: 

How can I disable browser back and refresh button in sap ui5

0 Kudos

Hello,

I am developing an application for pharma industry where I have to handle all navigation from application itself.

But while clicking the browser back or refresh button navigation also happening, so wanted to check these two events.

Any help in this will be appreciated.

Thank you,

Kumar Gaurav

Former Member
0 Kudos

Hi Gaurav,

Did you find any solution to this? I have a similar requirement like this.

Regards,

Ankur

Accepted Solutions (1)

Accepted Solutions (1)

Sharathmg
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Sharath,

I have tried all the solution mentioned in the link. The only solution which worked partially is:

history.pushState(null,null, document.URL);
window.addEventListener('popstate',function(){
    history.pushState(null,null, document.URL);});
But it also restricts it for one click only, if you click again on Back button it will start behaving like old way. Can you explain in more detail if you have already tried this use case.
Best Regards,
Ankur
Sharathmg
Active Contributor
0 Kudos

Never tried it myself.

Answers (0)