'How to navigate to other pages in Capacitor JS and keep existing button events i.e. backbutton?

When I navigate to to other HTML pages in CapacitorJS the events of the buttons are gone.

Is there a way to set theses events and other variables like "application wide" independent of what HTML I navigate in the application?

To be clear: I have several HTML files in my project, when I navigate from index to other pages the backbutton events are lost... there is a way so set it once in the loaded JS file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source