Don't count timeoutAbort in obsolete main_frame as errors.

This commit is contained in:
FelisCatus 2015-02-28 00:57:41 +08:00
parent 7b18737876
commit b650ab31b6
2 changed files with 3 additions and 1 deletions

View File

@ -149,6 +149,7 @@ module.exports = class WebRequestMonitor
} }
setTabRequestInfo: (status, req) -> setTabRequestInfo: (status, req) ->
console.log(req.tabId, status, req.type, req.url)
info = @tabInfo[req.tabId] info = @tabInfo[req.tabId]
if info if info
if status == 'start' and req.type == 'main_frame' if status == 'start' and req.type == 'main_frame'
@ -159,6 +160,7 @@ module.exports = class WebRequestMonitor
if (oldStatus = info.requestStatus[req.requestId]) if (oldStatus = info.requestStatus[req.requestId])
info[@eventCategory[oldStatus] + 'Count']-- info[@eventCategory[oldStatus] + 'Count']--
else else
return if status == 'timeoutAbort'
info.requestCount++ info.requestCount++
info.requestStatus[req.requestId] = status info.requestStatus[req.requestId] = status
info[@eventCategory[status] + 'Count']++ info[@eventCategory[status] + 'Count']++

View File

@ -816,7 +816,7 @@ class Options
profile = OmegaPac.Profiles.byName(@_currentProfileName, @_options) profile = OmegaPac.Profiles.byName(@_currentProfileName, @_options)
if not profile?.rules? if not profile?.rules?
return Promise.reject new Error( return Promise.reject new Error(
"Cannot add condition to Profile #{@profile.name} (@{profile.type})") "Cannot add condition to Profile #{@profile.name} (#{profile.type})")
target = OmegaPac.Profiles.byName(profileName, @_options) target = OmegaPac.Profiles.byName(profileName, @_options)
if not target? if not target?
return Promise.reject new ProfileNotExistError(profileName) return Promise.reject new ProfileNotExistError(profileName)