Greasy Fork is available in English.

GSMArena Highlight Compare Differences


// ==UserScript==
// @name        GSMArena Highlight Compare Differences
// @author      Jefferson "jscher2000" Scher
// @namespace   JeffersonScher
// @description See
// @license     BSD 3-clause
// @include*
// @version     0.1.1
// @grant       none
// ==/UserScript==

// Only run if a second phone was selected (check for presence of nfo2 entries)
var test = document.getElementsByClassName("nfo2");
if (test.length > 0){
  // Add rules to style rows designated as having differences
  var s = document.createElement("style");
  s.setAttribute("type", "text/css");
  s.appendChild(document.createTextNode(".hcdiff .ttl, .hcdiff .nfo, .hcdiff .nfo2{background:#ffb !important; box-shadow:inset 0 0 .45em #ee0 !important;}"));
  // Check all rows under #specs-list (there are numerous tables in here)
  var rows = document.querySelectorAll("#specs-list tr");
  for (var i=0; i<rows.length; i++){
    if (rows[i].children.length > 1){
      // Compare the last cell in the row to the send-to-last (needed because numbers of cells can vary)
      if (rows[i].lastElementChild.innerHTML != rows[i].lastElementChild.previousElementSibling.innerHTML){
        rows[i].className = "hcdiff";