Highlight oma valinta annokset lol
当前为
// ==UserScript==
// @name Highlight oma valinta
// @namespace 1N07
// @version 0.2
// @description Highlight oma valinta annokset lol
// @author 1N07
// @match https://www.foodora.fi/*/restaurant/*
// @icon https://www.google.com/s2/favicons?domain=foodora.fi
// @grant none
// ==/UserScript==
(function() {
'use strict';
var names = ["oma valinta", "kuten haluatte", "fantasia", "your choice"];
setInterval(CheckForOmaValinta, 200);
function CheckForOmaValinta() {
let found = document.querySelectorAll("[data-testid='menu-product-name']:not(.highlight-checked)");
for(let i = 0; i < found.length; i++)
{
found[i].classList.add("highlight-checked");
for(let j = 0; j < names.length; j++)
{
if(found[i].innerHTML.toLowerCase().includes(names[j].toLowerCase()))
{
let target = found[i];
while(!target.classList.contains('dish-card'))
target = target.parentNode;
target.style.backgroundColor = "rgba(112, 255, 60, 0.33)";
j = names.length; //break inner loop
}
}
}
}
})();