CB-7690 InAppBrowser loadstart/loadstop events issues
Subscribing to events before navigating
This commit is contained in:
+7
-1
@@ -77,7 +77,7 @@ InAppBrowser.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function(strUrl, strWindowName, strWindowFeatures) {
|
||||
module.exports = function(strUrl, strWindowName, strWindowFeatures, callbacks) {
|
||||
// Don't catch calls that write to existing frames (e.g. named iframes).
|
||||
if (window.frames && window.frames[strWindowName]) {
|
||||
var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
|
||||
@@ -86,6 +86,12 @@ module.exports = function(strUrl, strWindowName, strWindowFeatures) {
|
||||
|
||||
strUrl = urlutil.makeAbsolute(strUrl);
|
||||
var iab = new InAppBrowser();
|
||||
|
||||
callbacks = callbacks || {};
|
||||
for (var callbackName in callbacks) {
|
||||
iab.addEventListener(callbackName, callbacks[callbackName]);
|
||||
}
|
||||
|
||||
var cb = function(eventname) {
|
||||
iab._eventHandler(eventname);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user