Skip to content

Instantly share code, notes, and snippets.

@zakuroishikuro
Created September 3, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakuroishikuro/6b2c98b82c78aafb9ffc7c5b4939045c to your computer and use it in GitHub Desktop.
Save zakuroishikuro/6b2c98b82c78aafb9ffc7c5b4939045c to your computer and use it in GitHub Desktop.
https://node.green/ でv18とv12の差分だけ表示するブックマークレット
javascript:{
const [v12,v18] = [".v12", ".v18"].map(v=>document.querySelector(v).cellIndex);
const style = document.createElement("style");
style.textContent = `
th, td {display: none}
td:nth-child(1),
th:nth-child(${v12 + 1}), th:nth-child(${v18 + 1}),
td:nth-child(${v12 + 1}), td:nth-child(${v18 + 1})
{
display: table-cell;
}
`;
document.head.appendChild(style);
for (const table of document.body.querySelectorAll("table.results")) {
for (const row of table.rows) {
const [v12r,v18r] = [v12, v18].map(v=>row.cells[v]?.textContent);
if (v12r && v18r && v12r == v18r)
row.style.display = "none";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment