Last active
June 1, 2020 19:31
-
-
Save splintor/00b77e6ceefaaa5708bc15546b49aa8c to your computer and use it in GitHub Desktop.
Zap.co.il Highlight diffs in compare window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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