Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * How to use:
- * 1. Open google.com
- * 2. Open Developer console (CTRL+SHIFT+J then choose "console")
- * 3. Paste this entire script and enter
- * Enjoy!
- */
- const el = document.body;
- function test() {
- return new Promise(resolve => {
- setTimeout(() => {
- el.style.backgroundColor = '#' + (Math.floor(Math.random() * 0xffffff)).toString(16);
- resolve();
- }, 1000/30);
- }).then(test);
- }
- test();
- const el_foot = document.getElementById('fbar');
- function test_foot() {
- return new Promise(resolve => {
- setTimeout(() => {
- el_foot.style.backgroundColor = '#' + (Math.floor(Math.random() * 0xffffff)).toString(16);
- resolve();
- }, 1000/30);
- }).then(test_foot);
- }
- test_foot();
Add Comment
Please, Sign In to add comment