Advent of Code Title Highlighter

Each day of Advent of Code includes a message that is revealed when you hover over a certain piece of text. This script makes it easy to find that message by highlighting the piece of text that includes it.

  1. // ==UserScript==
  2. // @name Advent of Code Title Highlighter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Each day of Advent of Code includes a message that is revealed when you hover over a certain piece of text. This script makes it easy to find that message by highlighting the piece of text that includes it.
  6. // @author Ahmet Kun
  7. // @match https://adventofcode.com/*/day/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let spans = document.querySelectorAll('article span[title]');
  17. spans.forEach(span => {
  18. span.style.textDecoration = 'underline';
  19. span.style.color = 'red';
  20. });
  21. })();