Windows 8.1 introduced significant changes in how different components handle Proxy Auto-Config (PAC) files. While traditional IE11 continues to support most legacy debugging methods, Modern UI apps (now called Universal Windows Platform apps) operate with a completely different network stack.
For IE11 debugging, we have several technical approaches:
// Example PAC function with debug output
function FindProxyForURL(url, host) {
// Output to IE11's JavaScript console
if (console && console.log) {
console.log("PAC Evaluation - URL: " + url + ", Host: " + host);
}
// Alternative debug method using external logging
try {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.OpenTextFile("C:\\pac_debug.log", 8, true);
file.WriteLine((new Date()) + " - " + url + " | " + host);
file.Close();
} catch(e) {}
return "DIRECT";
}
Key IE11 debugging techniques:
- Use F12 Developer Tools (Network tab shows proxy decisions)
- Check
about:internet
in IE11 address bar for connection information - Monitor traffic with Fiddler or Wireshark
The Modern UI environment presents unique challenges:
// Modern UI compatible PAC debug approach
function FindProxyForURL(url, host) {
// Windows Store apps can't use traditional alert() or console.log()
// Instead, we need to use ETW (Event Tracing for Windows)
try {
var logMessage = "PAC: " + url + " | " + host;
var etwProvider = new ActiveXObject("ETW.Provider");
etwProvider.LogMessage(0, 0, 0, logMessage);
} catch(e) {}
// Return proxy configuration
if (shExpMatch(host, "*.microsoft.com")) {
return "PROXY proxy.example.com:8080";
}
return "DIRECT";
}
Essential tools for Modern UI PAC debugging:
- Windows Performance Analyzer (WPA) for ETW traces
- Network Isolation Tool (
CheckNetIsolation.exe
) - Windows Event Viewer (Filter for Network-related events)
To identify differences between IE11 and Modern UI behavior:
// PAC function to detect caller type
function FindProxyForURL(url, host) {
var callerType = "Unknown";
// Detect IE11 vs. Modern UI
try {
if (typeof window === 'object' && window.navigator) {
callerType = "IE11";
} else {
callerType = "ModernUI";
}
} catch(e) {
callerType = "ModernUI";
}
// Return different proxies for testing
if (callerType === "IE11") {
return "PROXY ieproxy.example.com:8080";
} else if (callerType === "ModernUI") {
return "PROXY modernproxy.example.com:8080";
}
return "DIRECT";
}
For low-level debugging:
netsh trace start scenario=internetclient capture=yes persistent=no tracefile=C:\temp\net_trace.etl
netsh trace stop
Analyze the resulting ETL file with WPA to see:
- PAC file loading events
- Proxy resolution attempts
- Network stack behavior differences
When Modern UI apps fail to connect while IE11 works:
- Verify loopback is enabled (
CheckNetIsolation LoopbackExempt
) - Check Windows Firewall rules for Modern apps
- Test with a simple PAC file that returns "DIRECT"
- Ensure the PAC file uses compatible JavaScript (no DOM methods)
For complex environments, consider:
// Example of conditional proxy selection
function FindProxyForURL(url, host) {
// Bypass proxy for local addresses
if (isPlainHostName(host) ||
shExpMatch(host, "*.local") ||
isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0")) {
return "DIRECT";
}
// Modern UI specific handling
try {
if (typeof window === 'undefined') {
return "PROXY modernproxy:8080; DIRECT";
}
} catch(e) {}
// Default proxy for IE11
return "PROXY defaultproxy:8080; DIRECT";
}
Windows 8.1 introduced significant changes to how both IE11 and Modern UI apps handle PAC files. The traditional alert()
debugging method that worked in Windows 7/IE10 no longer functions, creating new challenges for network administrators and developers.
For Internet Explorer 11, you can leverage these approaches:
// Example PAC function with logging
function FindProxyForURL(url, host) {
// Log to console (viewable via F12 Developer Tools)
console.log("Evaluating URL: " + url);
// Return different proxies for testing
if (shExpMatch(host, "*.internal.company.com")) {
return "PROXY internal-proxy:8080";
}
return "DIRECT";
}
Key IE11 debugging methods:
- Use F12 Developer Tools (Network tab) to monitor proxy decisions
- Check
about:internetsettings
for active proxy configuration - Enable script logging via registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Diagnostics)
Modern UI apps use a different network stack (WinINET vs. Windows.Web.Http) which handles PAC files differently:
// Example of checking network capabilities in a Modern app
Windows.Networking.Connectivity.NetworkInformation.getNetworkConnectivityProfile()
.then(function(profile) {
if (profile.getNetworkConnectivityLevel() ===
Windows.Networking.Connectivity.NetworkConnectivityLevel.none) {
console.log("No connectivity detected");
}
});
Troubleshooting steps for Modern apps:
- Verify PAC file accessibility (must be hosted on HTTP/HTTPS, not file://)
- Check Windows Firewall rules for Modern apps
- Use
netsh winhttp show proxy
to verify system-wide proxy settings - Test with a simple PAC file that returns only "DIRECT"
For comprehensive debugging:
// PowerShell script to monitor proxy resolution
Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections |
ForEach-Object {
Write-Host $_.PSChildName
Get-ItemProperty $_.PSPath
}
Additional tools:
- Fiddler with WinConfig to examine Modern app traffic
- Process Monitor to track PAC file access
- Network Tracing (netsh trace start scenario=internetclient capture=yes)
Specific issues to check:
- PAC file encoding must be ANSI or UTF-8 without BOM
- Timeout handling differs between IE11 and Modern apps
- Authentication requirements may block Modern apps
- Check Group Policy settings affecting proxy configuration