handleBack does not work on a real WebOS device

I’m trying to use the _handleBack() inside a page to close a videoPlayer and return to the previous page in a real WeboOS device but apparently, the _handleBack() does not work, I’ve also tried to catch and log in the console the keyboardEvent using the catchall _handleKey() but it does not catch the back, I press any other key (left, right, etc) and it works but with the back key it does not register anything, the unusual thing is that it does return to the previous page but without going through the handlers.


I’m under the impression that WebOS is setting focus on the videoPlayer and it is capturing the key events. So you may need to check the videoPlayer code to see if it is receiving the key events. Also depending on how WebOS works the video player might not be in the browser and when back is happening its calling back on the browser and not sending the event to Lightning at all. These are all probably issues you will have to “hack” for that platform and not Lightning framework related.

You might be able to use

As the browser is probably losing focus, you might get an event to let you know.

You need to set the disableBackHistoryAPI: true in your appinfo.json.

Here you have the official guide for handling the back button on WebOS: https://webostv.developer.lge.com/develop/guides/back-button#handling-a-back-button-event