Google Ads 表格行数计数器
显示一个浮动徽章,标示活动或关键字表格中当前可见的行数。
可复制的代码
/* Show a floating badge with the number of visible table rows */
(function () {
var badge = document.createElement('div');
badge.style.cssText =
'position:fixed;bottom:12px;right:12px;z-index:99999;' +
'background:#1a73e8;color:#fff;font:600 12px sans-serif;' +
'padding:6px 10px;border-radius:14px;pointer-events:none;' +
'box-shadow:0 2px 6px rgba(0,0,0,0.3)';
document.body.appendChild(badge);
function update() {
try {
var table = document.querySelector('table tbody') || document.querySelector('table');
var rows = table ? table.querySelectorAll('tr').length : 0;
badge.textContent = rows + ' rows';
} catch (e) {}
}
update();
new MutationObserver(update).observe(document.body, { childList: true, subtree: true });
})();
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 将代码粘贴到规则的 JavaScript 面板并保存 — 每次访问页面时都会运行。
为此示例评分
暂无评分 — 成为第一个。