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) {} +});