There are too many ways of doing this. The details matter.
For example, who needs to perform the detection? the server? the client?
Here are some random ideas:
If a browser tab/window contains an extension page, then the URL of that page looks like this:
So, you can use this URL do tell the difference between a regular http(s) page and an extension page.
But again, the details matter. If you explain the problem a bit more, we can come up with better solutions.