Google: show result rank and domain
Appends a small label with the rank number and domain to each title, handy for quick SEO analysis.
Code to copy
// Label each organic result with its host and rank for SEO checks
function labelResults() {
let rank = 0;
document.querySelectorAll('#search a > h3').forEach(function (h) {
const a = h.closest('a');
if (!a || a.dataset.jzRank) { return; }
rank += 1;
a.dataset.jzRank = rank;
let host = '';
try { host = new URL(a.href).hostname.replace(/^www\./, ''); }
catch (e) {}
const tag = document.createElement('span');
tag.textContent = '#' + rank + ' ' + host;
tag.style.cssText = 'display:inline-block;margin-left:8px;'
+ 'font:11px/1.4 monospace;color:#5f6368;background:#f1f3f4;'
+ 'padding:1px 6px;border-radius:4px;vertical-align:middle';
h.appendChild(tag);
});
}
labelResults();
const obs = new MutationObserver(labelResults);
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.