I had to do this in the past, which worked for me to grab the URL of a page with an involuntary portal (usually you can get this using curl to visit Google or something similar, and grab the response that will be redirected to you get to portal page in captivity.)
Once you have the url, just upload it to mobile safari and use debug mode. The inactive portal window is just a UIWebView using mobile safari, so debugging should be the same.
Unfortunately, there is no way that I know to debug directly in a hidden portal window.
Sammio2
source share