]> khamidou — GitHub mirrors - electron.git/commitdiff
Deprecate app.resolveProxy
authorCheng Zhao <zcbenz@gmail.com>
Thu, 19 Nov 2015 13:32:46 +0000 (21:32 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 19 Nov 2015 13:32:46 +0000 (21:32 +0800)
There is now a public API to get default session, this helper is no
longer necessary.

atom/browser/api/lib/app.coffee
docs/api/app.md
docs/api/session.md

index c2116fb7bca4a05d9b80f3eeabd81c6f080182ce..a2fdb847e1c563d018f17b23d7272adcf0bb970d 100644 (file)
@@ -34,10 +34,6 @@ app.setAppPath = (path) ->
 app.getAppPath = ->
   appPath
 
-# Helpers.
-app.resolveProxy = (url, callback) ->
-  session.defaultSession.resolveProxy url, callback
-
 # Routes the events to webContents.
 for name in ['login', 'certificate-error', 'select-client-certificate']
   do (name) ->
@@ -51,6 +47,8 @@ app.getDataPath = deprecate 'app.getDataPath', 'app.getPath', ->
   @getPath 'userData'
 app.setDataPath = deprecate 'app.setDataPath', 'app.setPath', (path) ->
   @setPath 'userData', path
+app.resolveProxy = deprecate 'app.resolveProxy', 'session.defaultSession.resolveProxy', (url, callback) ->
+  session.defaultSession.resolveProxy url, callback
 deprecate.rename app, 'terminate', 'quit'
 deprecate.event app, 'finish-launching', 'ready', ->
   setImmediate => # give default app a chance to setup default menu.
index d7850c4cb92cd701a22aef7ec3dad58e991d5ec2..a1d87d2fe9932d1d1ead57c866cd844f47b40100 100644 (file)
@@ -311,14 +311,6 @@ preferred over `name` by Electron.
 
 Returns the current application locale.
 
-### `app.resolveProxy(url, callback)`
-
-* `url` URL
-* `callback` Function
-
-Resolves the proxy information for `url`. The `callback` will be called with
-`callback(proxy)` when the request is performed.
-
 ### `app.addRecentDocument(path)` _OS X_ _Windows_
 
 * `path` String
index b921fc4839bdfdf8b55f4105c789ab2c1b49ade2..a69c5939ed65ae8ea418c8041da3b9b032e58cdc 100644 (file)
@@ -224,6 +224,14 @@ proxy-uri = [<proxy-scheme>"://"]<proxy-host>[":"<proxy-port>]
                                       URLs.
 ```
 
+### `ses.resolveProxy(url, callback)`
+
+* `url` URL
+* `callback` Function
+
+Resolves the proxy information for `url`. The `callback` will be called with
+`callback(proxy)` when the request is performed.
+
 #### `ses.setDownloadPath(path)`
 
 * `path` String - The download location