apache / apache/cordova-plugin-inappbrowser

InAppBrowser previous content persists after ref.show()

Open
#875 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

### Issue Type

- [x] Bug Report
- [ ] Feature Request
- [ ] Support Question

## Description
Tried to hide the window on the 'unload' event and show it on the 'loadstop' event. The previous content is shown initially and the new content starts drawing after which makes a flicker. I assume this is not the expected behavior.

### Command or Code
```
ref.addEventListener('loadstop', () => {
ref.executeScript({
code: `
window.addEventListener("beforeunload", function(event) {
webkit.messageHandlers.cordova_iab.postMessage(JSON.stringify({
hide: true,
}))
});
`
});
});
```

Platform: Android 9.0
Cordova: 10.0.0
InAppBrowser: 5.0.0

## Checklist

- [x] I searched for already existing GitHub issues about this
- [x] I updated all Cordova tooling to their most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Reproduce the Android 9.0 flow around ref.show(), loadstop, and the beforeunload handler, then trace the InAppBrowser Android implementation responsible for displayed content during navigation. Done means ref.show() no longer briefly displays the previous page before the new content is drawn.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.