Add some feature detection for older browsers. See #1608.

This commit is contained in:
FelisCatus 2018-08-26 19:35:19 -07:00
parent fdde592412
commit eb6aeb0ec5
2 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
OmegaTarget = require('omega-target')
# The browser only accepts native promises as onRequest return values.
# DO NOT USE Bluebird Promises here!
NativePromise = Promise
NativePromise = Promise ? null
ProxyImpl = require('./proxy_impl')
class ListenerProxyImpl extends ProxyImpl
@isSupported: -> browser?.proxy?.onRequest?
@isSupported: -> Promise? and browser?.proxy?.onRequest?
features: ['fullUrl', 'socks5Auth']
constructor: ->
super(arguments...)

View File

@ -1,6 +1,6 @@
window.onerror = (message, url, line, col, err) ->
log = localStorage['log'] || ''
if err.stack
if err?.stack
log += err.stack + '\n\n'
else
log += "#{url}:#{line}:#{col}:\t#{message}\n\n"