From 822faa74e350bb4149671328163fb58014cc87da Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 27 Dec 2015 01:49:18 -0500 Subject: [PATCH] code review: more in line with Google Analytics doc --- 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 eed70a871..96ff68f84 100644 --- a/assets/checksums.txt +++ b/assets/checksums.txt @@ -5,7 +5,7 @@ f7c529ec45cca5b2a584a2597c2e96a3 assets/ublock/filters.txt 146704ad1c0393e342afdb416762c183 assets/ublock/badware.txt 5baa90e2da7cd6a73edff2010557ee57 assets/ublock/redirect.txt 890e6b30c6a4cfd2ac5aa1bbe36d30fe assets/ublock/experimental.txt -5830ba4852b7dda0950d955ce95eb91e assets/ublock/resources.txt +42bf6b936b33ba0f7bb03a87dbd40160 assets/ublock/resources.txt 9b486d2c137467e2f4c651c0f8e721c8 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 b2f08b87d..02f02ccbb 100644 --- a/assets/ublock/resources.txt +++ b/assets/ublock/resources.txt @@ -173,11 +173,14 @@ www.google-analytics.com/ga.js application/javascript www.google-analytics.com/analytics.js application/javascript (function() { - var ga = function(a, b, c, d, e, f) { - if ( typeof f !== 'object' || typeof f.hitCallback !== 'function' ) { + // https://developers.google.com/analytics/devguides/collection/analyticsjs/ + var ga = function() { + var len = arguments.length; + if ( len === 0 ) { return; } - if ( d === 'click' ) { + var f = arguments[len-1]; + if ( typeof f === 'object' && typeof f.hitCallback === 'function' ) { f.hitCallback(); } };