How to Dismiss the Youtube TV Popup Window?


Is there a good way to dismiss the YouTube popup below?
It pops up every time when I open visit YouTube.


Install a Ad blocking browser extension and it will remove that eg uBlock Origin

Hi @macdevign_mac,

Thank you very much!
I was using another adblocker extension and that one did not remove it. uBlock Origin does the trick!

Update: it turns out the uBlock Origin does not dismiss the popup either. The floating window still shows up.

I have lots of code that dismisses various pop-ups in Youtube. That one that you show here is a more recent pop-up that I haven't coded anything for yet, but it's easy enough. Really easy.

What I would do is, say, every two seconds, perform an OCR of the browser using the Monterey Shortcuts OCR function which is extremely fast and accurate (even faster since we can select only the bottom part of the browser window, since that pop-up is always near the bottom of the screen.)

Now if your pop-up always appears in the exact same location, the solution is nearly trivial. Simply create a loop performing the OCR on the browser, and if the phrase "get the TV you love" appears in the result, simply use a KM action to click on the location where the Dismiss button appears. This would take only about three lines of KM code, I think.

If you want to be able to move and resize the browser window and its contents, this would require a lot more work, but it would still be doable. You didn't say whether you need to handle pop-ups in different locations.

If you want to dismiss those rectangle pop-ups in the window itself, this is also doable, but it's very tricky and I've never had that working 100%.

I'd like to point out that all these pop-ups that I'm talking about are affected by the Zoom level of the browser. This is why Find Image isn't as useful a tool as OCR for this task.

Thanks, @Sleepy.

That's a very creative way of solving the problem.
I was thinking of a javascript solution. Javascript will allow variations of position or zooming level of the browser. I will be busy in the following few days. When I have time, I will try myself to make one. I'll share here if when I do.

Thanks for the compliment. But I can't deal with Javascript, so you are on your own.

However I have managed to get KM to handle difficult things like browser window repositioning, Youtube player size changes, zoom level changes, and combinations of the above.

The OCR solution is surprisingly effective, fast and entertaining. Especially on M1 Macs.

1 Like

I'm not too sure why it's still show up. I only use that blocker and I didn't see the trial popup coming out. Anyway, if you really want to resolve that, I suggest using Tampermonkey extension to write simple code to remove that specific element. Tampermonkey is one of those extensions that if you learn it, it can be another Aha moment just like KM

1 Like

I see the trial ad every time I visit youtube for the first time of the day. After that, it will not show up again for the rest of the day. That's why I thought uBlock worked last time, b/c I was not seeing them until the following day.
I do not keep my account logged in. This might be another factor. But I don't know.

Thanks for the recommendation. I've been using Tampermonkey for a while. It's an incredibly useful extension and I use it everyday. Since the youtube tv ad pops up only for the first time of the day, I was thinking maybe Keyboard Maestro is a better choice (as I need to execute the javascript only once a day? I don't need it to execute every time I visit youtube).

Mysteriously, the TV ad never pops up since then. So no further actions are needed now, and I'm very happy with it.