apache / apache/cordova-plugin-inappbrowser

Can't get beforeload to fire

Open
#553 2 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

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

## Description
Hi,
I haven't been able to get the `beforeload` event to fire at all, and I'm wondering if I'm doing this wrong.
## Information

I'm trying to run this on a "Hello World" PhoneGap template while trying to reference the newest version of this plugin:
```

```
If there's something I missed or if I'm completely missing something here, please let me know!
### Command or Code

```
try {
app.receivedEvent('deviceready');

function beforeLoadFn(params, callback) {
alert("onbeforeload event fired with data: " + JSON.stringify(params));
}
myInAppBrowser = cordova.InAppBrowser.open("https://www.google.com/", "_blank", "location=yes,hidden=no,beforeload=yes");
myInAppBrowser.addEventListener("beforeload", beforeLoadFn);
}
catch (err) {
alert(err);
}
```
### Environment, Platform, Device

Server: PhoneGap v0.4.5 on macOS with (I hope) cordova-plugin-inappbrowser v3.1.0
Client: PhoneGap Developer 1.8.4 on Android 9.0 (Pie)

### Version information

PhoneGap v0.4.5

## 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

Start by reproducing the issue through cordova.InAppBrowser.open on Android 9 with cordova-plugin-inappbrowser 3.1.0, using the supplied beforeloadFn listener and beforeload=yes option. Compare the observed behavior with the plugin's beforeload entry point and determine whether the event fires as documented; done means the cause or a reproducible plugin defect is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.