Skip to content

Commit a392bb3

Browse files
committed
newwin: new-win-policy event
1 parent cd62190 commit a392bb3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/resources/api_nw_newwin.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ forEach(currentNWWindowInternal, function(key, value) {
122122
NWWindow.prototype[key] = value;
123123
});
124124

125-
NWWindow.prototype.onNewWinPolicy = new Event();
125+
NWWindow.prototype.onNewWinPolicy = new Event("nw.Window.onNewWinPolicy");
126126
NWWindow.prototype.onNavigation = new Event();
127127
NWWindow.prototype.LoadingStateChanged = new Event();
128128
NWWindow.prototype.onDocumentStart = new Event("nw.Window.onDocumentStart");
@@ -695,9 +695,7 @@ function dispatchEventIfExists(target, name, varargs) {
695695

696696
function onNewWinPolicy(frame, url, policy) {
697697
//console.log("onNewWinPolicy called: " + url + ", " + policy);
698-
if (!currentNWWindow)
699-
return;
700-
dispatchEventIfExists(currentNWWindow, "onNewWinPolicy", [frame, url, policy]);
698+
dispatchEventNW("nw.Window.onNewWinPolicy", [frame, url, policy]);
701699
}
702700

703701
function onNavigation(frame, url, policy, context) {

0 commit comments

Comments
 (0)