apache / apache/cordova-plugin-inappbrowser
Android Disable Back Button Option
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
# Feature Request
Option to disable the Android hardware back button functionality.
## Motivation Behind Feature
I have an app in which I have disabled the back button. I use keycloak-js as my authentication mechanism. When the user starts the authentication process, keycloak-js spawns the inappbrowser. I do not want the user to be able to hit the back button once the inappbrowser has opened.
On iOS, setting "toolbar: no" makes it impossible to go back, but on Android because of the current "harwareback" implementation, this is not possible.
The "hardwareback" option currently allows back to either go back, or close the inappbrowser, neither option are equivalent to the iOS setup where I cannot go back.
## Feature Description
Add a new android option for hardwarebackdisabled: yes/no, defaults to no. I suggest a new option since changing the hardwareback would break compatibility,
## Alternatives or Workarounds
I have no workarounds at this time.
Contributor guide
Research direction
Start by tracing the Android hardwareback implementation and how its current option is read. Confirm where Android plugin options are handled, then verify that a hardwarebackdisabled option can prevent both back navigation and closing the in-app browser while preserving existing behavior by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100