js bookmarklet (w/ click event listner) doesnt work on firefox

Viewed 8

thank you for reading this.
i made a bookmarklet code just for me, the code is shown below.
this would make click event listner on "window", so just after running this bookmarklet,
i can click on certain div then the div would be "invisible(display:none)".

javascript:window.onclick=e=>{window.onclick=null;e.target.style.display='none';};

i am happy that it works good as my intension... but it works only on Chrome.
it doesnt work on Firefox displaying new page e=>{window.onclick=null;e.target.style.display='none';}
it doesnt work on Edge, without any clue.

i guess like, when i make a code for bookmarklet, there maybe some considerations for cross-browsing.
but i am not capable of yet.
please help me to make it work on other browsers. thank you in advance.

0 Answers
Related