Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'omp-jb52731' into 'master'
[embedlite-components] Add API for handling popupblocked events.  Contributes to JB#52731

See merge request mer-core/embedlite-components!117
  • Loading branch information
rainemak committed Apr 21, 2021
2 parents bb57f9f + d7398c4 commit cd5ae4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jscomps/ContentPermissionManager.js
Expand Up @@ -92,7 +92,7 @@ ContentPermissionManager.prototype = {
permissionToCookieAccess(parseInt(data.permission)));
}
Services.perms.add(Services.io.newURI(data.uri, null, null),
data.type, parseInt(data.permission));
data.type, parseInt(data.permission), parseInt(data.expireType));
debug("set, uri: " + data.uri
+ ", type: " + data.type
+ ", permission: " + data.permission);
Expand Down
10 changes: 7 additions & 3 deletions jscomps/EmbedLiteChromeManager.js
Expand Up @@ -84,12 +84,15 @@ EmbedLiteChromeListener.prototype = {
}

break;
case "DOMWillOpenModalDialog":
case "DOMModalDialogClosed":
case "DOMWindowClose":
case "DOMWillOpenModalDialog":
case "DOMModalDialogClosed":
case "DOMWindowClose":
messageName = "chrome:winopenclose";
message["type"] = event.type;
break;
case "DOMPopupBlocked":
this.sendAsyncMessage("embed:popupblocked", { host: event.target.URL});
break;
}

if (messageName) {
Expand Down Expand Up @@ -129,6 +132,7 @@ EmbedLiteChromeManager.prototype = {
chromeEventHandler.addEventListener("DOMModalDialogClosed", chromeListener, false);
chromeEventHandler.addEventListener("DOMWindowClose", chromeListener, false);
chromeEventHandler.addEventListener("DOMMetaAdded", chromeListener, false);
chromeEventHandler.addEventListener("DOMPopupBlocked", chromeListener, false);
} else {
Logger.warn("Something went wrong, could not get chrome event handler for window", aWindow, "id:", chromeListener.windowId, "when opening a window")
}
Expand Down

0 comments on commit cd5ae4f

Please sign in to comment.