History

Ignore more script injection errors

Thibaut Courouble committed 10 years ago

Commit 8340ccf1 parent 74673951 file · +6 −1Browse files

Unified · Split

assets/javascripts/app/app.coffee+6−1
@@ -56,6 +56,11 @@ · 55 unmodified lines
5656 tags:
5757 mode: if @DOC then 'single' else 'full'
5858 iframe: (window.top isnt window).toString()
59+ shouldSendCallback: ->
60+ if @isInjectionError()
61+ @onInjectionError()
62+ return false
63+ true
5964 dataCallback: (data) ->
6065 try
6166 $.extend(data.user ||= {}, app.settings.settings)
@@ -215,7 +220,7 @@ · 153 unmodified lines
215220 isInjectionError: ->
216221 # Some browser extensions expect the entire web to use jQuery.
217222 # I gave up trying to fight back.
218− window.$ isnt app._$ or window.$$ isnt app._$$ or window.page isnt app._page
223+ window.$ isnt app._$ or window.$$ isnt app._$$ or window.page isnt app._page or typeof $.empty isnt 'function' or typeof page.show isnt 'function'
219224
220225 isAppError: (error, file) ->
221226 # Ignore errors from external scripts.