From beadfee0a853f5b5ce20372a73ec9193302e8f75 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 5 Jan 2016 15:40:23 -0500 Subject: [PATCH] hardening neutered google-analytics.com/analytics.js against client-code exceptions --- assets/checksums.txt | 2 +- assets/ublock/resources.txt | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/checksums.txt b/assets/checksums.txt index d8cd1df86..6caef1aeb 100644 --- a/assets/checksums.txt +++ b/assets/checksums.txt @@ -5,7 +5,7 @@ 146704ad1c0393e342afdb416762c183 assets/ublock/badware.txt 5baa90e2da7cd6a73edff2010557ee57 assets/ublock/redirect.txt f9bb491dbba453752199e8378ee152bb assets/ublock/experimental.txt -f2442847428017dc37c6bbf36f834149 assets/ublock/resources.txt +f215de20c0944dcb286757966a233f42 assets/ublock/resources.txt fe4e995a7a828da38fcb0188c3996dbc assets/ublock/filter-lists.json 50573388b525ede1a920cd4b4ee7fbf0 assets/thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt 61cc16cf02e034370f0f47bc17c46551 assets/thirdparties/easylist-downloads.adblockplus.org/easylist.txt diff --git a/assets/ublock/resources.txt b/assets/ublock/resources.txt index 98a8794b5..3041b2c05 100644 --- a/assets/ublock/resources.txt +++ b/assets/ublock/resources.txt @@ -203,9 +203,12 @@ google-analytics.com/analytics.js application/javascript if ( len === 0 ) { return; } - var f = arguments[len-1]; - if ( typeof f === 'object' && f !== null && typeof f.hitCallback === 'function' ) { - f.hitCallback(); + try { + var f = arguments[len-1]; + if ( typeof f === 'object' && f !== null && typeof f.hitCallback === 'function' ) { + f.hitCallback(); + } + } catch (ex) { } }; ga.create = function() {