0

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?

luek baja
  • 1,475
  • 8
  • 20
  • why? whats the problem in creating this as a web extension, you will have more control there to work with, there is an entire API dedicated to dev tools in extensions. – Ace Feb 11 '21 at 02:26
  • Also Content Security Policy will block out your bookmarklets before they can inject any code, so its is totally depends on website whether your bookmarklet will run or not, and also due to security reasons bookmarklets are blocked by many browsers, and ad blocking addons. https://stackoverflow.com/a/7607789/10249176 – Ace Feb 11 '21 at 02:32

1 Answers1

0

You could use localStorage to set whether it's been clicked.