2021年2月10日星期三

Check if bookmark has been clicked without setting a global variable in JavaScript

Basically the same idea as this question but checking if a bookmark was clicked.

I am creating an inspect element based dev tool that runs through a bookmarklet.

When they click the bookmark the first time, it should initialize and show the inspect pop-up. When they click it a second time, it should hide the pop-up. But when they click it a third time, it should only show the pop-up and not re-initialize. Because it will need to run on any website, it is important that I do not do things like pollute the global scope or the DOM, etc.

Is this possible?

https://stackoverflow.com/questions/66147789/check-if-bookmark-has-been-clicked-without-setting-a-global-variable-in-javascri February 11, 2021 at 10:04AM

没有评论:

发表评论