Greasy Fork is available in English.

Foodora - Highlight items (EN|FI|+)

Highlight items on Foodora (fantasy / fantasia highlighted by default) (EN|FI|+)

  1. // ==UserScript==
  2. // @name Foodora - Highlight items (EN|FI|+)
  3. // @namespace 1N07
  4. // @version 0.4.2
  5. // @description Highlight items on Foodora (fantasy / fantasia highlighted by default) (EN|FI|+)
  6. // @author 1N07
  7. // @license unlicense
  8. // @match https://www.foodora.fi/*restaurant/*
  9. // @match https://www.foodora.se/*restaurant/*
  10. // @match https://www.foodora.no/*restaurant/*
  11. // @match https://www.foodora.hu/*restaurant/*
  12. // @match https://www.foodora.cz/*restaurant/*
  13. // @match https://www.foodora.at/*restaurant/*
  14. // @icon https://www.google.com/s2/favicons?domain=foodora.fi
  15. // @compatible firefox Only tested on Firefox with Tampermonkey, but should probably work on pretty much all browsers and script managers
  16. // @compatible chrome Only tested on Firefox with Tampermonkey, but should probably work on pretty much all browsers and script managers
  17. // @compatible opera Only tested on Firefox with Tampermonkey, but should probably work on pretty much all browsers and script managers
  18. // @compatible edge Only tested on Firefox with Tampermonkey, but should probably work on pretty much all browsers and script managers
  19. // @compatible safari Only tested on Firefox with Tampermonkey, but should probably work on pretty much all browsers and script managers
  20. // @grant none
  21. // ==/UserScript==
  22.  
  23. (function() {
  24. 'use strict';
  25.  
  26. //Note, names are not case sensitive
  27. var names = [
  28. "my choice",
  29. "your choice",
  30. "fantasy",
  31. "oma valinta",
  32. "kuten haluatte",
  33. "fantasia"
  34. ];
  35.  
  36. setInterval(CheckForOmaValinta, 200);
  37.  
  38. function CheckForOmaValinta() {
  39. let found = document.querySelectorAll("[data-testid='menu-product-name']:not(.highlight-checked)");
  40. for(let i = 0; i < found.length; i++)
  41. {
  42. found[i].classList.add("highlight-checked");
  43. for(let j = 0; j < names.length; j++)
  44. {
  45. if(found[i].innerHTML.toLowerCase().includes(names[j].toLowerCase()))
  46. {
  47. let target = found[i];
  48. while(!target.classList.contains('product-tile'))
  49. target = target.parentNode;
  50. target = target.getElementsByClassName("product-tile__animation-overlay")[0];
  51. target.style.backgroundColor = "rgba(112, 255, 60, 0.33)";
  52. j = names.length; //break inner loop
  53. }
  54. }
  55. }
  56. }
  57. })();