krasimir / kuker

Kick-ass browser extension to debug your apps
https://chrome.google.com/webstore/detail/glgnienmpgmfpkigngkmieconbnkmlcn
MIT License
659 stars 26 forks source link

Detecting kuker #7

Open streamich opened 6 years ago

streamich commented 6 years ago

I see this in docs

In the beginning there was a guard in the emitters that makes sure that events are sent only if the extension is installed. However, this technique involves the content script of the extension to inject some stuff on the page which was fragile and buggy. I decided to kill that feature until I find a better way to handle it. So, for the time being you have to guard the emitters.

So, as I understand there is no way to detect if kuker is present from the page? Or is there?

For example I would like to ship a kuker emitter with zero configuration: in development it would detect if kuker is present and automatically use it.

krasimir commented 6 years ago

There is a way to detect if Kuker is installed and the answer is here. There are couple of solutions like making a http request to chrome://<extension id> or using chrome.extensions API.

In the very beginning there was such code in every of the Kuker's emitters. However, I decided to remove it. First because it is a little bit tricky and in some cases was skipping events. Also I don't like the fact that in my production code I have something that is strictly about development workflows. I'd better remove that code from my bundle.