Back button exiting app when it should not

Our app has recently started behaving differently when using the Back button on the LG remote. Previously it would only exit to LG Home using the Back button in one scenario only, and we could override this button for other parts of the app. However now, any time the Back button is pressed from the first page in the app, it will go to the LG Home screen, even though our code prevents this, and we have not made code changes recently to this behaviour.

We have the following set up in the app as defined in https://webostv.developer.lge.com/develop/guides/back-button#implementing-the-back-button-function-to-exit-the-app , but can you please advise if there are any other settings or values that should be used?

  • "disableBackHistoryAPI": true in the appinfo.json file
  • Back = 461 used as the LGRemoteKeys key code for ‘Back’
  • We use window.close() to exit the app but this should only happen from one place

Please check again with a simple test app like this:

// appinfo.json
{
    ...
    disableBackHistoryAPI: true;
    ...
}

// index.html
<script>
window.addEventListener("keydown", function(inEvent) {
    if (window.event) {
        keycode = inEvent.keyCode;
    } else if (e.which) {
        keycode = inEvent.which;
    }
    if (keycode === 461) { // Do nothing
      console.log(keycode);
    }
});
</script>