← All examples

JavaScript Developer & QA vimeo.com

Vimeo: show the video ID

Displays the numeric ID of the current video in a small pinned badge in the corner of the screen.

Code to copy

// Show the numeric Vimeo video ID in a small fixed badge
function showId() {
  const m = location.pathname.match(/\/(\d{6,})/);
  let badge = document.getElementById('jz-vmo-id');
  if (!m) { if (badge) badge.remove(); return; }
  if (!badge) {
    badge = document.createElement('div');
    badge.id = 'jz-vmo-id';
    badge.style.cssText = 'position:fixed;bottom:8px;left:8px;z-index:99999;background:#000;color:#0ff;font:12px monospace;padding:3px 7px;border-radius:4px;';
    document.body.appendChild(badge);
  }
  badge.textContent = 'video id: ' + m[1];
}
showId();
const obs = new MutationObserver(showId);
obs.observe(document.documentElement, { childList: true, subtree: true });

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. 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.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases