Skip to content

Commit

Permalink
Fix win.getPrinters undefined under nw2
Browse files Browse the repository at this point in the history
Ref #5875
  • Loading branch information
rogerwang committed Jun 2, 2019
1 parent f416c2c commit 4aef8c2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/resources/api_nw_newwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ function NWWindow(cWindow) {
chrome.windows.onWindowChanged.addListener(updateWindowAttributes);
}

forEach(currentNWWindowInternal, function(key, value) {
if (!key.endsWith('Internal'))
NWWindow.prototype[key] = value;
});

NWWindow.prototype.onNewWinPolicy = bindingUtil.createCustomEvent("nw.Window.onNewWinPolicy", false, false);
NWWindow.prototype.onNavigation = bindingUtil.createCustomEvent("nw.Window.onNavigation", false, false);
NWWindow.prototype.LoadingStateChanged = bindingUtil.createCustomEvent("nw.Window.LoadingStateChanged", false, false);
Expand Down Expand Up @@ -615,6 +610,10 @@ Object.defineProperty(NWWindow.prototype, 'frameId', {
apiBridge.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
currentNWWindowInternal = getInternalApi('nw.currentWindowInternal');
forEach(currentNWWindowInternal, function(key, value) {
if (!key.endsWith('Internal'))
NWWindow.prototype[key] = value;
});
apiFunctions.setHandleRequest('get', function(domWindow) {
if (domWindow)
return try_nw(domWindow.top).nw.Window.get();
Expand Down

0 comments on commit 4aef8c2

Please sign in to comment.