From 8c900de458ed53fe756ced0d785c277fd53ff757 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 21 Oct 2018 00:39:28 +0200 Subject: [PATCH] js --- main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 3a0b1f4..3794ca1 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ -try { - (function() { +window.addEventListener('load', function() { + try { var inputs = document.querySelectorAll('input[type="text"], input[autofocus], input[placeholder]'); var inputsLength = inputs.length; @@ -8,7 +8,7 @@ try { } var profile = document.querySelector('.profile'); - + if (profile) { var currentTab = profile.querySelector('.menu a.item.active'); @@ -36,5 +36,5 @@ try { window.clearInterval(stylusInterval); } }, 100); - })(); -} catch(e) {} + } catch (e) {} +});