Comments (12)
Hey folks. Just released a Chrome/Firefox-extension version that should block ads. Give it a try: https://github.com/odensc/ttv-ublock/tree/extension (instructions in readme)
Remove any previous uBlock script you may have installed.
from ttv-ublock.
Yes the script currently doesn't work as stated in the Reddit post. Also I have never recommended Alternate Player?
Nov 8th edit: #3 (comment)
from ttv-ublock.
I never said you recommended it, a lot of people have been, I felt like saying that it wasn't worth the trade off for me beforehand in case you do, I think it just came off wrong
from ttv-ublock.
what if we override the access_token response and set the 3 variables (or more) regarding ads to disable them. It would look something like this:
/// twitch-videoad.js
const origFetch = window.fetch;
window.fetch = (url, init, ...args) => {
if (typeof url === "string" && url.includes("/access_token")) {
var response;
return origFetch(url, init, ...args)
.then(function(res){response = res; return res.json()})
.then(function(new_body) {
new_body.token = new_body.token.replace("\"hide_ads\":false", "\"hide_ads\":true")
.replace("\"server_ads\":true", "\"server_ads\":false")
.replace("\"show_ads\":true", "\"show_ads\":false");
return new Response(JSON.stringify(new_body), {
status: response.status,
statusText: response.statusText,
headers: response.headers });
});
}
return origFetch(url, init, ...args);
};
doubt the ads could be controlled client side, but maybe it would work? I can override it in console, but not with ublock (probably missing something stupid).
from ttv-ublock.
doubt the ads could be controlled client side, but maybe it would work? I can override it in console, but not with ublock (probably missing something stupid).
You can try using UserScript managers like ViolentMonkey
from ttv-ublock.
I haven't thoroughly tested but setting the query params "player_type" to "mobile" and "platform" to "android" seems to fix, ie:
url = url.replace("player_type=site", "player_type=mobile");
url = url.replace("platform=web", "platform=android");
and
newBody.variables.playerType = "mobile";
newBody.variables.platform = "android";
from ttv-ublock.
I haven't thoroughly tested but setting the query params "player_type" to "mobile" and "platform" to "android" seems to fix, ie:
url = url.replace("player_type=site", "player_type=mobile"); url = url.replace("platform=web", "platform=android");
and
newBody.variables.playerType = "mobile"; newBody.variables.platform = "android";
still got an ad but seems less frequent than without that patch. They probably serve less ads to mobile users?
edit: nvm i'm getting ads every stream
from ttv-ublock.
After making the changes I mentioned, if I refresh the page after an ad shows up it goes away. I think that's why people are using userscripts to automate this.
from ttv-ublock.
Hey folks. Just released a Chrome/Firefox-extension version that should block ads. Give it a try: https://github.com/odensc/ttv-ublock/tree/extension (instructions in readme)
Remove any previous uBlock script you may have installed.
This seems to be working on initial tests.
from ttv-ublock.
do we have to re-download it every time twitch patch fix?
from ttv-ublock.
It doesn't work.
from ttv-ublock.
The new chrome extension is working great! Thanks for your hard work @odensc
from ttv-ublock.
Related Issues (18)
- Commercial break in progress HOT 35
- Any plans to put the extension on the Chrome Web Store? HOT 4
- We broke again boys HOT 175
- Ads in pop out player HOT 4
- No channel points HOT 2
- Ads get through twitch streams..... yet AGAIN HOT 9
- I want to send you money. HOT 1
- Firefox extension no longer blocking prerolls HOT 14
- Purple warning screen showing up when using extension HOT 214
- Here is how another project blocked embedded ads HOT 3
- Twitch is now detecting this, and giving out a warning message HOT 1
- Getting ads again on Firefox 85.0b2 HOT 9
- Publish to MS Edge Store HOT 1
- how install in edge? HOT 4
- Constant Errors HOT 4
- Not blocking ads with the extension HOT 24
- Ads rolling again :( HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttv-ublock.