bochove opened a new issue, #1084:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/1084
# Bug Report
## Problem
var options = "location=yes,hidden=yes,beforeload=yes";
inAppBrowserRef = cordova.InAppBrowser.open(url, target, options);
inAppBrowserRef.addEventListener('beforeload', (params, callback) => {
if (params.url.startsWith("http://www.example.com/")) {
// Load this URL in the inAppBrowser.
callback(params.url);
} else {
// The callback is not invoked, so the page will not be loaded.
$('#status-message').text("This browser only opens pages on
http://www.example.com/");
}
});
### What is expected to happen?
No typescript errors to be reported, as this is basically your own
documentation example
### What does actually happen?
No overload matches this call.
Overload 1 of 2, '(type: channel, callback:
InAppBrowserEventListenerOrEventListenerObject): void', gave the following
error.
Argument of type '"beforeload"' is not assignable to parameter of type
'channel'.
Overload 2 of 2, '(type: string, callback:
InAppBrowserEventListenerOrEventListenerObject): void', gave the following
error.
Argument of type '(params: any, callback: any) => void' is not
assignable to parameter of type
'InAppBrowserEventListenerOrEventListenerObject'.
Type '(params: any, callback: any) => void' is not assignable to type
'InAppBrowserEventListener'.
Target signature provides too few arguments. Expected 2 or more, but
got 1.ts(2769)
### Version information
latest version
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]