Skip to content

Instantly share code, notes, and snippets.

@splintor
Last active June 1, 2020 19:31
Show Gist options
  • Save splintor/00b77e6ceefaaa5708bc15546b49aa8c to your computer and use it in GitHub Desktop.
Save splintor/00b77e6ceefaaa5708bc15546b49aa8c to your computer and use it in GitHub Desktop.
Zap.co.il Highlight diffs in compare window
// ==UserScript==
// @name Zap.co.il Highlight diffs in compare window
// @namespace http://shmulik.flint.org/
// @version 0.2
// @description Highlight different rows when comparing items
// @author Shmulik Flint
// @match https://www.zap.co.il/compare.aspx?*
// @updateURL https://gist.github.com/splintor/00b77e6ceefaaa5708bc15546b49aa8c/raw
// @downloadURL https://gist.github.com/splintor/00b77e6ceefaaa5708bc15546b49aa8c/raw
// @grant GM_addStyle
// ==/UserScript==
'use strict';
GM_addStyle(`
.detailsRow.different * {
background-color: lemonchiffon !important;
font-weight: bold;
}
`);
const rows = [...document.getElementsByClassName('detailsRow')];
rows.forEach(row => {
const values = [...row.getElementsByClassName('detailsRowTxt')];
if (values.some(v => v.innerText !== values[0].innerText)) {
row.classList.add('different');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment