Skip to content

Instantly share code, notes, and snippets.

@prednaz
Created July 15, 2024 19:51
Show Gist options
  • Save prednaz/adf1e69c8190448ba332566925108768 to your computer and use it in GitHub Desktop.
Save prednaz/adf1e69c8190448ba332566925108768 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name amazon_skip_advertisement
// @match *://www.amazon.de/*
// @grant none
// ==/UserScript==
const traverse_videos = (f) => {Array.from(document.getElementsByTagName("video")).forEach(f)};
document.addEventListener(
"click",
(event) =>
{
if (!document.querySelector(".atvwebplayersdk-ad-timer-countdown").contains(event.target)) {return;}
traverse_videos(v => {v.fastSeek(v.currentTime + 13)});
event.preventDefault();
event.stopPropagation();
},
true
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment