淡化展示次数为零的行
淡化 Google Ads 表格中展示次数为零的行,让你专注于活跃项目。
可复制的代码
/* Dim rows with zero impressions to focus on active items */
(function () {
function scan() {
try {
var heads = document.querySelectorAll('th, [role="columnheader"]');
var idx = -1;
heads.forEach(function (h, i) {
if (/impr/i.test(h.textContent || '')) {
idx = Array.prototype.indexOf.call(h.parentNode.children, h);
}
});
if (idx < 0) return;
document.querySelectorAll('tr, [role="row"]').forEach(function (r) {
var cell = r.children[idx];
if (!cell) return;
var v = (cell.textContent || '').replace(/[^0-9]/g, '');
if (v === '0' || (cell.textContent || '').trim() === '0') {
r.style.opacity = '0.5';
}
});
} catch (e) {}
}
scan();
new MutationObserver(scan).observe(document.body, { childList: true, subtree: true });
})();
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 将代码粘贴到规则的 JavaScript 面板并保存 — 每次访问页面时都会运行。
为此示例评分
暂无评分 — 成为第一个。