-
Notifications
You must be signed in to change notification settings - Fork 0
/
hide-strands-hint.js
36 lines (32 loc) · 1.12 KB
/
hide-strands-hint.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ==UserScript==
// @name Hide Strands Hint
// @namespace http://tampermonkey.net/
// @version 2024-07-15
// @description hide the Strands hint until you click on it
// @author Nick Eby
// @match https://www.nytimes.com/games/strands
// @icon https://www.google.com/s2/favicons?sz=64&domain=nytimes.com
// ==/UserScript==
(function() {
'use strict';
let intvl;
let hintText;
let hintElem;
const hideHint = () => {
try {
console.log('try to hide');
hintElem = document.getElementById('riddle').getElementsByTagName('h1')[0];
hintText = hintElem.innerText;
hintElem.innerText = '';
hintElem.innerHTML = '<button onclick="window.revealStrandsHint()" style="font-size: inherit; background: transparent;">Click to reveal hint!</button>';
window.clearInterval(intvl);
console.log('hidden');
}
catch {}
}
window.revealStrandsHint = () => {
hintElem.innerHTML = '';
hintElem.innerText = hintText;
}
intvl = window.setInterval(hideHint, 250);
})();