#1461: hardened experimental scriplet

This commit is contained in:
gorhill 2016-03-13 13:11:14 -04:00
parent 9ca616fefd
commit 3ed3c27277
2 changed files with 38 additions and 11 deletions

View File

@ -5,7 +5,7 @@ dcc881135f01d1e264c2be59a8aaa1e0 assets/ublock/filters.txt
98088252cedafb8571cf61b91bea219e assets/ublock/badware.txt
5baa90e2da7cd6a73edff2010557ee57 assets/ublock/redirect.txt
b65ec581214a0d24dad6522a60f827ab assets/ublock/experimental.txt
36418463fe1f706e56e8f74371d1c12c assets/ublock/resources.txt
5ee3e1aa589018d7abf5978306e2c018 assets/ublock/resources.txt
059e0bfbf22bd242dda7b07389fe09a2 assets/ublock/filter-lists.json
3605c73f21abca428c7eb69a8bc32dfe assets/thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt
a91af77c47c302c0741c7445b0fada1a assets/thirdparties/easylist-downloads.adblockplus.org/easylist.txt

View File

@ -830,23 +830,50 @@ disqus.com/embed.js application/javascript
ytad-defuser.js application/javascript
(function() {
var ytp, ytpc;
Object.defineProperty(window, 'ytplayer', {
get: function() {
return ytp;
},
set: function(a) {
ytp = a;
var trapytpca = function() {
if ( ytpc && ytpc.args && typeof ytpc.args.ad_slots === 'string' ) {
ytpc.args.ad_slots = ytpc.args.ad_slots.replace(/^0+(,|$)/, '');
}
};
var trapytpc = function() {
ytpc = ytp.config;
if ( ytpc ) {
trapytpca();
return;
}
try {
Object.defineProperty(ytp, 'config', {
get: function() {
return ytpc;
},
set: function(a) {
ytpc = a;
if ( a && a.args && typeof a.args.ad_slots === 'string' ) {
a.args.ad_slots = a.args.ad_slots.replace(/^0+(,|$)/, '');
trapytpca();
}
});
} catch (ex) {
}
};
var trapytp = function() {
ytp = window.ytplayer;
if ( ytp ) {
trapytpc();
return;
}
try {
Object.defineProperty(window, 'ytplayer', {
get: function() {
return ytp;
},
set: function(a) {
ytp = a;
if ( !a.config ) {
trapytpc();
}
}
});
}
});
} catch (ex) {
}
};
trapytp();
})();