Firefox has stack-less errors.

Filter those errors out, and when possible don't send anything.
This commit is contained in:
Mayhem 2013-07-07 21:45:30 +02:00
parent fa50087323
commit e16fefb31f

View File

@ -339,7 +339,7 @@ Main =
postErrors: -> postErrors: ->
return if Main.v2Detected return if Main.v2Detected
errors = Main.errors.map (d) -> errors = Main.errors.filter((d) -> !!d.error.stack).map((d) ->
{stack} = d.error {stack} = d.error
<% if (type === 'userscript') { %> <% if (type === 'userscript') { %>
# Before: # Before:
@ -350,6 +350,8 @@ Main =
stack = stack.replace /file:\/{3}.+\//g, '' if stack stack = stack.replace /file:\/{3}.+\//g, '' if stack
<% } %> <% } %>
"#{d.message} #{stack}" "#{d.message} #{stack}"
).join '\n'
return unless errors
$.ajax '<%= meta.page %>errors', {}, $.ajax '<%= meta.page %>errors', {},
sync: true sync: true
form: $.formData form: $.formData
@ -357,7 +359,7 @@ Main =
t: '<%= type %>' t: '<%= type %>'
ua: window.navigator.userAgent ua: window.navigator.userAgent
url: window.location.href url: window.location.href
e: errors.join '\n' e: errors
isThisPageLegit: -> isThisPageLegit: ->
# 404 error page or similar. # 404 error page or similar.