squgeim / yt-ad-autoskipper

A browser extension that automates skipping ad on Youtube. This is not an ad blocker, it just automates the process of clicking on the "Skip Ad" button on Youtube.
https://chrome.google.com/webstore/detail/youtube-ad-auto-skipper/lokpenepehfdekijkebhpnpcjjpngpnd
GNU General Public License v3.0
277 stars 57 forks source link

Basic skip function has stopped working completely. #77

Closed sher10cat closed 2 months ago

sher10cat commented 3 months ago

I didn't want to give the extension a one-star review, just because it stopped working. I would rather report the issue, and ask the dev to try and fix it. (I'll only leave a negative review if the extension remains non-working long-term.)

Yeah, the skip function has completely stopped working (at least for me). I tried switching it off and back on. I tried uninstalling, and reinstalling. It still isn't working at all...

I use the latest version of Chrome, on Windows 11 PC. Thanks.

jonocodes commented 3 months ago

Started happening for me too about 2 days ago in firefox. Perhaps a change on the youtube side.

danarjordan commented 3 months ago

Same issue here. Started happening a few days ago. I'm using Firefox 129.0.2 on Win 11 and ver. 0.5.3 of the extension.

squgeim commented 3 months ago

Hey guys! I have been trying to figure out this issue. It seems to be intermittent and I personally have not experienced it yet. Can you tell me what location you are in? Perhaps YouTube is AB testing some change in your geographical region. I will try using a VPN to see if I can experience it.

In the mean time I am going to push out a few tweaks -- hopefully it'll help. I'll also try to include a way for the extension to send back some diagnostic data if it can't skip an ad so I can easily debug.

russellsilva commented 3 months ago

The extension stopped working today for me as well. I'm in Portland, Oregon, USA. Can provide additional information if needed. Thanks as always for the wonderful extension.

jrawle commented 3 months ago

For me, if I click the Extensions toolbar button, this add-on is greyed out and says "Can't always read and change data on this site". The skip button does look slightly different. Presumably YouTube have changed something that means the button is not detected (the new version may be phased in for different users).

sher10cat commented 3 months ago

@jrawle - Hmmm. I don't get any greying out or error message. It simply doesn't work.

@squgeim - I am located in Canada.

danarjordan commented 3 months ago

I am in OH but use a VPN server in Chicago. But since I'm always signed into YouTube I assume they would target me by my Google account rather than a geographical block. For me the issue is consistent. Ever since sometime last week the ads are never automatically skipped.

jestinjoshi commented 3 months ago

Hey guys! I have been trying to figure out this issue. It seems to be intermittent and I personally have not experienced it yet. Can you tell me what location you are in?

I'm from Toronto, Canada and it has stopped working for me as well.

cverges-medallia commented 3 months ago

I took a few screenshots of the DOM when it was occurring. Will try to test again next time it occurs. Located in the Northeast US, started reliably happening ~3 days ago.

Screenshot 2024-08-30 at 12 45 45 AM Screenshot 2024-08-30 at 12 45 36 AM

siniarskimar commented 3 months ago

Same situation in Poland. Seems like they changed the behavior from #74 to just skipping the event silently.

I've looked through the obfuscated code of the 'click' event on the skip button with the use of Firefox JS debugger. It seems like Youtube is tracking the mouse position on the video player with the use of their advertisement platform and then determines if the click was genuine user click. The code responsible, uses some kind of command dispatch with unique id, which makes me believe this is what is actually going on.

Might be worth experimenting if firing couple 'mouseover' events on the video player before the click will do something

My bad, I was looking at the skip button wrapper

squgeim commented 3 months ago

The issue did start happening with me as well. Looks like it's becoming universal. Although I did just receive a review that says it started working again.

I was able to walk through their obfuscated code; the check essentially boils down to whether or not the click even has isTrusted flag set. This flag is set by the browser only if the event originated from user action.

I am trying to find workarounds for it.

squgeim commented 3 months ago

This is the key function. a is the click event, and the event handler returns early if this function returns 0. It also checks and collects if the click happened before the button became visible, but doesn't seem to use that info to block yet.

cta = function (a, b) {
  var c = 1,
    d = [];
  try {
    var e = document.querySelector(".ytp-ad-skip-button-slot");
    e
      ? getComputedStyle(e).display === "none"
        ? d.push("BISCOTTI_BASED_DETECTION_STATE_IS_BUTTON_INVISIBLE")
        : d.push("BISCOTTI_BASED_DETECTION_STATE_IS_BUTTON_VISIBLE")
      : d.push("BISCOTTI_BASED_DETECTION_STATE_IS_BUTTON_NOT_FOUND");
  } catch (f) {
    d.push("BISCOTTI_BASED_DETECTION_STATE_IS_FINDING_BUTTON_FAILURE");
  }
  a.isTrusted === !0
    ? d.push("BISCOTTI_BASED_DETECTION_STATE_IS_CLICK_EVENT_TRUSTED")
    : a.isTrusted === !1
    ? d.push("BISCOTTI_BASED_DETECTION_STATE_IS_CLICK_EVENT_NOT_TRUSTED")
    : d.push("BISCOTTI_BASED_DETECTION_STATE_IS_CLICK_EVENT_TRUSTED_UNDEFINED");
  d.includes("BISCOTTI_BASED_DETECTION_STATE_IS_CLICK_EVENT_NOT_TRUSTED") &&
    (c = 0);
  Pq("ISDSTAT", c);
  fy(c, "i.s_", {
    rfa: "sk",
    metadata: b,
    states: d,
  });
  return c;
};
roxiemic commented 3 months ago

Its been happening to me and I recently emailed you because I thought it was something I could fix.

sher10cat commented 3 months ago

Hey @squgeim - Thanks so much for listening to us, and working hard on finding the fix! We're rooting for you. 😸 We appreciate your extension very much! 💖 I hope you can figure out how to make it work again. This is such an important app, and as far as I know, the only one of its kind.

casuallysentient commented 3 months ago

agree with @sher10cat , thank you @squgeim - it's not a surprise that youtube, who i've just noticed is starting to get even MORE agressive with their ads (e.g., the "skip" button being replaced with a "next" button to take you to another ad) is finding ways to circumvent the tools made to combat their greediness. but your effort here is genuinely appreciated. wishing you the best and make sure you're taking care of yourself. thank you for everything you do.

siniarskimar commented 3 months ago

It's going to be hard to circumvent isTrusted unless the extension somehow patches that piece of code before its execution. Even if that would be possible, YouTube might just re-obfuscate the code. The only way currently to forge isTrusted events is with usage of a web-driver (Selenium and others)

This will quickly turn into a cat & mouse game with YouTube. For stubborn users, it might be worth consideration of alternative YT front-ends or using yt-dlp

NOTE: The mute button still works with JavaScipt click event

squgeim commented 2 months ago

I was able to fix the behaviour and have sent the extension for review from Chrome Web Store. We'll see what the review will be like in a few days. 🤞

sher10cat commented 2 months ago

@squgeim Hey, Shreya. 😻 Thank you, thank you, thank you ! ! !

squgeim commented 2 months ago

It has been approved on Chrome! Please update to 2.1.0 and let me know if it works for you all!

It's not been approved on Firefox yet. I'll update here when that happens.

rowdynl commented 2 months ago

It has been approved on Chrome! Please update to 2.1.0 and let me know if it works for you all!

It's not been approved on Firefox yet. I'll update here when that happens.

Although it's not mentioned in the Readme, I guess this is also a official add-on in the Edge store? Is it something that will come to Edge also? I'm experiencing the same issues. ;)

russellsilva commented 2 months ago

It's working again for me. You're a hero @squgeim, thanks so much.

squgeim commented 2 months ago

Although it's not mentioned in the Readme, I guess this is also a official add-on in the Edge store? Is it something that will come to Edge also? I'm experiencing the same issues. ;)

Review for Edge usually takes much longer than Chrome or Firefox. It should be updated within the week.

squgeim commented 2 months ago

Although it's not mentioned in the Readme, I guess this is also a official add-on in the Edge store? Is it something that will come to Edge also? I'm experiencing the same issues. ;)

Review for Edge usually takes much longer than Chrome or Firefox. It should be updated within the week.

Extension has been rejected from Edge and it looks like the feature I am leveraging for the latest fix is not supported on Edge. I am considering pulling it out of Edge store if I can't work around it as you can still install it from Chrome Web Store.

bu-ton commented 2 months ago

@squgeim Thanks again for fixing the program. I appreciate it very much. I would love to subscribe to your subs, do you have any plans to support paypal instead of stripe?

squgeim commented 2 months ago

@squgeim

Thanks again for fixing the program. I appreciate it very much.

I would love to subscribe to your subs, do you have any plans to support paypal instead of stripe?

Unfortunately not at the moment. I do have a PayPal link in the readme. I can unlock paid features on an on request basis.

squgeim commented 2 months ago

Although it's not mentioned in the Readme, I guess this is also a official add-on in the Edge store? Is it something that will come to Edge also? I'm experiencing the same issues. ;)

Review for Edge usually takes much longer than Chrome or Firefox. It should be updated within the week.

Extension has been rejected from Edge and it looks like the feature I am leveraging for the latest fix is not supported on Edge. I am considering pulling it out of Edge store if I can't work around it as you can still install it from Chrome Web Store.

I have found a bug report on Edge about the issue that's blocking me from releasing. I'll keep an eye on the progress there, but until that's resolved I can't release the fix there.

rowdynl commented 2 months ago

Although it's not mentioned in the Readme, I guess this is also a official add-on in the Edge store? Is it something that will come to Edge also? I'm experiencing the same issues. ;)

Review for Edge usually takes much longer than Chrome or Firefox. It should be updated within the week.

Extension has been rejected from Edge and it looks like the feature I am leveraging for the latest fix is not supported on Edge. I am considering pulling it out of Edge store if I can't work around it as you can still install it from Chrome Web Store.

I used this a s a workaround. Thanks.

nicholas-eden commented 2 months ago

How did you fix it?

squgeim commented 2 months ago

Update was finally accepted and published on Firefox!

sher10cat commented 2 months ago

@squgeim Hey Shreya!!! THANK YOU for being so attentive, and working to troubleshoot the issue and correct it, so that it is working again. I have left a 5-star review on the Google Chrome extension page. ★★★★★ https://chromewebstore.google.com/detail/lokpenepehfdekijkebhpnpcjjpngpnd

Do you have a link to send you a tip ( like ko-fi.com )?

Also, I noticed the description on the Chrome extension page says there is a premium option of only $7 USD per year (58 cents per month!). Where is the link to sign up? Thanks!

squgeim commented 2 months ago

Thanks everyone! This fix was really a challenge and I am super happy I was able to make it work.

Do you have a link to send you a tip ( like ko-fi.com )?

Also, I noticed the description on the Chrome extension page says there is a premium option of only $7 USD per year (58 cents per month!). Where is the link to sign up? Thanks!

I do have a PayPal link. You can click on the extension setting in the browser to subscribe to paid features (like auto muting ads, configure the number of seconds to wait for ads to skip, per channel configuration). Unfortunately this is only available on Chrome and Edge as Firefox's Manifest 3 implementation differs significantly from Chrome.

siniarskimar commented 2 months ago

This fix, just makes every event's isTrusted equal to true using JavaScript's Proxy object. That's all...

Which is funny that it works and it passed Firefox's and Chrome's audit. If there was any

muescha commented 1 month ago

This fix, just makes every event's isTrusted equal to true using JavaScript's Proxy object. That's all...

I would like to understand how this works. can you refer to a commit so see the changes and the workaround?

siniarskimar commented 1 month ago

This fix, just makes every event's isTrusted equal to true using JavaScript's Proxy object. That's all...

I would like to understand how this works. can you refer to a commit so see the changes and the workaround?

For whatever reason, the author of this extension does not push the changes to this repo. You have to search through the installed extension files in order to see the actual code. For Firefox, go to the folder where your profile is located (see about:profiles) and open "extensions". There should be a bunch of files with extension xpi, these are just archives that can be opened with eg. 7-Zip. One of these should be this extension, look at the manifest.json located in the archive.

muescha commented 1 month ago

You have to search through the installed extension files in order to see the actual code.

Thanks a lot for the tip! I used the "Chrome Extension Source Viewer" to look through the files, and I found the youtube_override.js file.

jeremymeyers commented 2 weeks ago

Can the Firefox extension be updated as well please