ncaa.com
Test link (required):
http://www.ncaa.com/march-madness-live/watch
Screenshot of the web page (required):

Screenshot of the console (press F12 to bring up the console) (required):

https://github.com/reek/anti-adblock-killer/issues/2965#issuecomment-287168823
Does that still work ?
@@||ncaa.com^$generichide only helps hiding the message...
The video doesn't play ? It used to play back in March, so what changed ?
Does it play for you?
No, that's why I asked.
Probably a bad filter from Easylist and co. Need to investigate what's broken.
Looks like they put ads loading inside their player...

This works:
@@||ncaa.com^$generichide
@@||fwmrm.net^$script,domain=ncaa.com
@@||moatads.com^$script,domain=ncaa.com
Real ads are still blocked, good enough for a workaround.
a.xhrSpoof from AAK-Cont can be handy in this case... It takes uBO filter as input, we might want to implement that differently for our case.
/**
* Modifies the response text of an XHR request.
* @method xhrSpoof
* @param urlFilter {String} Matches the request URL based on the adblock/uBlock filter syntax.
* @param replacement {String} The replacement for the response text.
*/
xhrSpoof(urlFilter, replacement) {
this.xhrSpoof.rules.push(this.urlFilterToRegex(urlFilter));
this.xhrSpoof.replacements.push(replacement);
if (!this.xhrSpoof.injected) {
let getReplacementIndex = (url) => {
let index = -1;
for (let i=0; i<this.xhrSpoof.rules.length; i++) {
if (this.xhrSpoof.rules[i].test(url)) {
index = i;
this.xhrSpoof.rules[i].lastIndex = 0;
break;
}
}
return index;
};
let getReplacementIndexName = this.exportFunction(getReplacementIndex);
let getReplacementValue = (index) => {
return this.xhrSpoof.replacements[index];
};
let getReplacementValueName = this.exportFunction(getReplacementValue);
this.addScript(`
(function(proxied) {
var getReplacementIndex = window.${getReplacementIndexName};
delete window.${getReplacementIndexName};
var getReplacementValue = window.${getReplacementValueName};
delete window.${getReplacementValueName};
window.XMLHttpRequest = function() {
var wrapped = new(Function.prototype.bind.apply(proxied, arguments));
var open = wrapped.open;
wrapped.open = function(method, url, async) {
// Determine absolute path
var link = document.createElement("a");
link.href = url;
let replacementIndex = getReplacementIndex(link.protocol+"//"+link.host+link.pathname+link.search+link.hash);
if (replacementIndex > -1) {
Object.defineProperty(this, "responseText", {
writable: true,
value: getReplacementValue(replacementIndex)
});
}
return open.call(wrapped, method, url, async);
};
return wrapped;
};
})(XMLHttpRequest);
`, this.scriptInjectMode.eval);
}
}
Eh... They use JSONP to load the file... Doesn't go through XMLHttpRequest, must use chrome.webRequest to loopback it... I think just whitelist it is fine, too much work to properly loopback it.
Loopback or not, it needs to be whitelisted in uBO. No real ads gets loaded, maybe we should leave this one like this for now...
It fetches the streaming API from the ad-server that's why it will remain broken unless whitelisted. The only way to patch this is to replace the player. They purpose fully did that so they can insert their shitty ads anytime they want as long as the domains are whitelisted so this is a compromise, not a solution.
Don't have to replace the player, loopback the request is enough, just pretty complex, I might do that, but it needs to be whitelisted in uBO either way or it may interfere with my loopback logic.
If more than one extension attempts to modify the request, the most recently installed extension wins and all others are ignored. An extension is not notified if its instruction to modify or redirect has been ignored.
I am able to stop the player from complaining, but the video still doesn't play...

I feel I'm pretty close, I think just the player extension event pump is not right.
I just realized that video stream links are in the ads request JSON...
I'm going to update background page so the extension is nooped, that's the best I can do, I don't think there is a way to get around sending request to fwmrm.net.
I nooped the SDK, alright, good enough.
Do we need to whitelist those domains anymore ?
Yes, otherwise loopback will be canceled.
a.staticServer(
[
"https://*.moatads.com/*/MoatFreeWheelJSPEM.js",
],
[
"script",
],
"data:text/javascript;base64,KCgpID0+IHsNCiAgICAidXNlIHN0cmljdCI7DQogICAgd2luZG93LmNvbnNvbGUuZXJyb3IoIlVuY2F1Z2h0IEVycm" +
"9yOiBGcmVlV2hlZWwgU0RLIGlzIG5vdCBhbGxvd2VkIG9uIHRoaXMgZGV2aWNlISIpOw0KICAgIHdpbmRvdy5Nb2F0RnJlZVdoZWVsSlNQRU0gPSBjbGFz" +
"cyB7DQogICAgICAgIGluaXQoKSB7IH0NCiAgICAgICAgZGlzcG9zZSgpIHsgfQ0KICAgIH07DQp9KSgpOw==",
);
There is no way around sending request to fwmrm.net though.