Summarize visible product statuses
Counts visible product rows by status and shows a quick summary of approved, disapproved and pending items.
Code to copy
(function () {
var rows = document.querySelectorAll('table tbody tr, [role="row"]');
var c = { approved: 0, disapproved: 0, pending: 0, expiring: 0, other: 0 };
rows.forEach(function (row) {
var t = (row.textContent || '').toLowerCase();
if (!t.trim()) return;
if (/disapproved|not approved/.test(t)) c.disapproved++;
else if (/pending|under review/.test(t)) c.pending++;
else if (/expiring|expires soon/.test(t)) c.expiring++;
else if (/approved|active/.test(t)) c.approved++;
else c.other++;
});
alert('Visible product rows\n' +
'Approved: ' + c.approved + '\n' +
'Disapproved: ' + c.disapproved + '\n' +
'Pending: ' + c.pending + '\n' +
'Expiring: ' + c.expiring + '\n' +
'Other: ' + c.other);
})();
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.
- 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.