It's more or less a javascript hack. Here's one article on it (I think it's webkit specific though) https://medium.freecodecamp.org/disabling-browser-incognito-...
If that doesn't work on Edge / Firefox there's likely other "hacky" alternatives (probably something around localstorage or cookies not being writable).