From: Cheng Zhao Date: Wed, 1 Jun 2016 05:57:35 +0000 (+0900) Subject: Explicitly initialize session before webContents X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bb8da60737802d9c4e09b2c813ec93539fb92be;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Explicitly initialize session before webContents --- diff --git a/lib/browser/api/app.js b/lib/browser/api/app.js index f8a531626..09835a792 100644 --- a/lib/browser/api/app.js +++ b/lib/browser/api/app.js @@ -1,6 +1,7 @@ 'use strict' -const {deprecate, Menu, session} = require('electron') +const electron = require('electron') +const {deprecate, Menu} = electron const {EventEmitter} = require('events') const bindings = process.atomBinding('app') @@ -49,7 +50,7 @@ app.allowNTLMCredentialsForAllDomains = function (allow) { if (!this.isReady()) { this.commandLine.appendSwitch('auth-server-whitelist', domains) } else { - session.defaultSession.allowNTLMCredentialsForDomains(domains) + electron.session.defaultSession.allowNTLMCredentialsForDomains(domains) } } diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index cb8cf41e3..059f204e1 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -1,7 +1,11 @@ 'use strict' const {EventEmitter} = require('events') -const {ipcMain, Menu, NavigationController} = require('electron') +const {ipcMain, session, Menu, NavigationController} = require('electron') + +// session is not used here, the purpose is to make sure session is initalized +// before the webContents module. +session const binding = process.atomBinding('web_contents') const debuggerBinding = process.atomBinding('debugger')