Skip to content
Permalink
Browse files
Make googletagmanager_gtm.js an alias of google-analytics_analytics.js
Related feedback:
- https://ilakovac.com/teespring-ublock-issue/

The surrogate script googletagmanager_gtm.js was essentially a
subset of surrogate script google-analytics_analytics.js. This
commit makes it a plain alias so that the whole GA API -- often
expected by clients of GTM -- is properly stubbed.

Related commits:
- gorhill/uBlock@8cd2a1d

Co-authored-by: Raymond Hill <rhill@raymondhill.net>
  • Loading branch information
JustOff and gorhill committed Jun 11, 2021
1 parent 5559561 commit 6d1c0c095bfaa639438643056708bcb572ff267d
Showing with 14 additions and 4 deletions.
  1. +11 −2 assets/resources/resources.txt
  2. +2 −1 src/js/assets.js
  3. +1 −1 src/js/start.js
@@ -379,8 +379,17 @@ google-analytics.com/analytics.js application/javascript
w[gaName] = ga;
// https://github.com/gorhill/uBlock/issues/3075
const dl = w.dataLayer;
if ( dl instanceof Object && dl.hide instanceof Object && typeof dl.hide.end === 'function' ) {
dl.hide.end();
if ( dl instanceof Object ) {
if ( dl.hide instanceof Object && typeof dl.hide.end === 'function' ) {
dl.hide.end();
}
if ( typeof dl.push === 'function' ) {
dl.push = function(o) {
if ( o instanceof Object && typeof o.eventCallback === 'function' ) {
setTimeout(o.eventCallback, 1);
}
};
}
}
// empty ga queue
if ( gaQueue instanceof Function && Array.isArray(gaQueue.q) ) {
@@ -307,7 +307,8 @@ api.fetchFilterList.legacy = {
'=google-analytics_ga.js': '=google-analytics.com/ga.js',
'=google-analytics_inpage_linkid.js': '=google-analytics.com/inpage_linkid.js',
'=googlesyndication_adsbygoogle.js': '=googlesyndication.com/adsbygoogle.js',
'=googletagmanager_gtm.js': '=googletagmanager.com/gtm.js',
'=googletagmanager_gtm.js': '=google-analytics.com/analytics.js',
'=googletagmanager.com/gtm.js': '=google-analytics.com/analytics.js',
'=googletagservices_gpt.js': '=googletagservices.com/gpt.js',
'=ligatus_angular-tag.js': '=ligatus.com/*/angular-tag.js',
'=monkeybroker.js': '=d3pkae9owd2lcf.cloudfront.net/mb105.js',
@@ -139,7 +139,7 @@ var onVersionReady = function(lastVersion) {
µb.assets.purge('ublock-resources');

// Force updating all filters due to filter syntax converter update.
if ( vAPI.app.compareVersions(lastVersion, "1.16.4.27") <= 0 ) {
if ( vAPI.app.compareVersions(lastVersion, "1.16.4.28") <= 0 ) {
µb.assets.purge(/./, 'public_suffix_list.dat');
}

0 comments on commit 6d1c0c0

Please sign in to comment.