From afba19a290cd6885cab8c4c238c76028104fe48d Mon Sep 17 00:00:00 2001 From: Procyon-b <40043075+Procyon-b@users.noreply.github.com> Date: Sun, 24 Jun 2018 16:48:00 -0400 Subject: [PATCH 1/5] DOMContentLoaded/load timer; name="" Fixes for #14 - as zipped at https://github.com/gregsadetsky/chrome-dont-add-custom-search-engines/issues/14#issuecomment-399790728 --- src/content.js | 74 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 15 deletions(-) mode change 100644 => 100755 src/content.js diff --git a/src/content.js b/src/content.js old mode 100644 new mode 100755 index 706b697..702b9c4 --- a/src/content.js +++ b/src/content.js @@ -1,11 +1,27 @@ -const DEBUG=false; +const DEBUG=true; let numseen=0, numspoiled=0; let unspoiled=[]; +// called when the user clicks an element of the form (any field or button). The parameter passed if the event object +function clickApply(e) { + if(DEBUG) console.info({'form onclick':e}); + // remove onclick. One fix only + e.srcElement.form.removeEventListener("click", clickApply); + applyFix(e.srcElement.form); +} + +// add a new