mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Add some feature detection for older browsers. See #1608.
This commit is contained in:
parent
fdde592412
commit
eb6aeb0ec5
@ -1,11 +1,11 @@
|
|||||||
OmegaTarget = require('omega-target')
|
OmegaTarget = require('omega-target')
|
||||||
# The browser only accepts native promises as onRequest return values.
|
# The browser only accepts native promises as onRequest return values.
|
||||||
# DO NOT USE Bluebird Promises here!
|
# DO NOT USE Bluebird Promises here!
|
||||||
NativePromise = Promise
|
NativePromise = Promise ? null
|
||||||
ProxyImpl = require('./proxy_impl')
|
ProxyImpl = require('./proxy_impl')
|
||||||
|
|
||||||
class ListenerProxyImpl extends ProxyImpl
|
class ListenerProxyImpl extends ProxyImpl
|
||||||
@isSupported: -> browser?.proxy?.onRequest?
|
@isSupported: -> Promise? and browser?.proxy?.onRequest?
|
||||||
features: ['fullUrl', 'socks5Auth']
|
features: ['fullUrl', 'socks5Auth']
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super(arguments...)
|
super(arguments...)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
window.onerror = (message, url, line, col, err) ->
|
window.onerror = (message, url, line, col, err) ->
|
||||||
log = localStorage['log'] || ''
|
log = localStorage['log'] || ''
|
||||||
if err.stack
|
if err?.stack
|
||||||
log += err.stack + '\n\n'
|
log += err.stack + '\n\n'
|
||||||
else
|
else
|
||||||
log += "#{url}:#{line}:#{col}:\t#{message}\n\n"
|
log += "#{url}:#{line}:#{col}:\t#{message}\n\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user