Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add surrogate script for addthis_widget.js #2300

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/data/surrogates.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const hostnames = {
],
'cdn.krxd.net': 'noopjs',
'widgets.outbrain.com': '/outbrain.js',
's7.addthis.com': '/addthis_widget.js',
};

/**
Expand Down Expand Up @@ -515,6 +516,27 @@ const surrogates = {
window.OBR = window.OBR || obr;
} + ')();',


// https://github.com/uBlockOrigin/uAssets/blob/577af0626fde9e7c48658891be045bd0fac7f27a/filters/resources.txt#L890-L906
'/addthis_widget.js': '(' +
function() {
var noopfn = function() {
;
};
window.addthis = {
addEventListener: noopfn,
button: noopfn,
init: noopfn,
layers: noopfn,
ready: noopfn,
sharecounters: {
getShareCounts: noopfn
},
toolbox: noopfn,
update: noopfn
};
} + ')();',

// https://github.com/uBlockOrigin/uAssets/blob/0efcadb2ecc2a9f0daa5a1df79841d794b83860f/filters/resources.txt#L38-L41
'noopjs': '(' +
function() {
Expand Down