← All examples

JavaScript Productivity arxiv.org

arXiv: floating Open PDF shortcut

Adds a persistent floating PDF button in the bottom-right corner so the full paper opens with a single click.

Code to copy

// Add a sticky "Open PDF" floating button on paper pages
(function () {
  if (!/\/abs\//.test(location.pathname)) { return; }
  if (document.getElementById('jzArxPdfBtn')) { return; }
  var id = (location.pathname.match(/\/abs\/([\w.\-\/]+)/) || [])[1];
  if (!id) { return; }
  var btn = document.createElement('a');
  btn.id = 'jzArxPdfBtn';
  btn.href = '/pdf/' + id;
  btn.target = '_blank';
  btn.rel = 'noopener noreferrer';
  btn.textContent = '↓ PDF';
  btn.title = 'Open PDF';
  btn.style.cssText = [
    'position:fixed', 'right:18px', 'bottom:28px',
    'padding:12px 18px', 'background:#b31b1b', 'color:#fff',
    'font-size:15px', 'font-weight:700', 'text-decoration:none',
    'border-radius:30px', 'box-shadow:0 4px 14px rgba(0,0,0,0.25)',
    'z-index:99999', 'letter-spacing:0.4px'
  ].join(';');
  document.body.appendChild(btn);
})();

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