My add-on, AsYouWish injects a global into every page to allow websites to make privileged requests of the browser upon user permission.
I recently discovered that bookmarklets also gain access to such injected variables (injected in the manner I described here).
While this could otherwise be a nice form of interaction to allow for users of my add-on, my concern is for the case where users have granted a particular trusted website privileges but a malicious third-party supplies a bookmarklet to the user which the user runs against the trusted website's context, thereby unwittingly granting privileges to the malicious code (and creating a kind of XSS attack).
Is there any way to either prevent a bookmarklet from gaining access to such globals or to be able to detect from within my injected methods whether the originating context were a bookmarklet or otherwise?