Spotify: auto-skip explicit tracks
Detects a playing track marked Explicit and automatically skips ahead to the next one.
Code to copy
// Skip the current track automatically if it is marked Explicit
let lastSkipped = '';
function skipExplicit() {
const widget = document.querySelector('[data-testid="now-playing-widget"]');
if (!widget) { return; }
const label = widget.getAttribute('aria-label') || '';
const isExplicit = widget.querySelector('[aria-label="Explicit"], [title="Explicit"]');
if (isExplicit && label && label !== lastSkipped) {
const next = document.querySelector('button[aria-label="Next"]');
if (next && !next.disabled) { lastSkipped = label; next.click(); }
}
}
const obs = new MutationObserver(skipExplicit);
obs.observe(document.documentElement, { childList: true, subtree: true });
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.