← All examples

Action Productivity allegro.pl

Copy order numbers

Collects every order number from the current seller-panel list and copies them to the clipboard, ready to paste.

Code to copy

try {
  var nums = [];
  document.querySelectorAll('[data-role="order-row"], tr').forEach(function (row) {
    try {
      var m = (row.textContent || '').match(/\b\d{8,}\b/);
      if (m) nums.push(m[0]);
    } catch (e) {}
  });
  var text = Array.from(new Set(nums)).join('\n');
  if (!text) { alert('Nie znaleziono numerow zamowien.'); }
  else if (navigator.clipboard && navigator.clipboard.writeText) {
    navigator.clipboard.writeText(text).then(function () {
      alert('Skopiowano ' + nums.length + ' numerow zamowien.');
    });
  } else {
    alert(text);
  }
} catch (e) { alert('Blad: ' + e.message); }

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. Enable the action panel, add a button in the Actions tab and paste the code into it — run it with one click.

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