Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

完美解決 Win8.1 IE11 相容性問題:User-Agent 字串缺少 MSIE 導致被誤判為 Firefox,修改登錄恢復 MSIE 標識

編輯:Windows 8 系統介紹

Windows 8.1 內建 IE11 變更 User-Agent 字串,移除 MSIE 關鍵字並保留 Trident/7.0 與 rv:11.0,導致許多網站伺服器端偵測邏輯誤判為 Firefox (因含 like Gecko),造成版面錯亂、功能失效。本文提供兩種解決方案:相容性檢視 (暫時) 與修改登錄 User-Agent (根治)。

問題根因

IE11 新 UA 字串:
Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
缺少 MSIE、含 Gecko → 伺服器端正則表達式誤判為 Gecko 核心瀏覽器 (Firefox)。

方案一:相容性檢視設定 (網站層級、暫時)

  1. IE11 右上角工具 (齒輪) →「相容性檢視設定」。
  2. 將問題網站加入清單,勾選「使用 Microsoft 相容性清單」。
  3. 該網站將以 IE10/IE9 模式轉譯,UA 字串包含 MSIE。

方案二:修改登錄強制 User-Agent 含 MSIE (一勞永逸、全域)

  1. Win + R → regedit 開啟登錄編輯器。
  2. 瀏覽至:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
  3. 右鍵新增 DWORD (32 位元) 值,名稱為目標程式 (如 iexplore.exe),數值資料設為 8000 (十六進位) / 32768 (十進位) → 強制 IE8 模式 UA。
    更精準做法:新增 HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_USER_AGENT_STRING 字串值,自訂完整 UA 字串,例如:
    Mozilla/5.0 (MSIE 8.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    含 MSIE 8.0 即可正確被識別為 IE。

驗證結果

修改後新 UA 字串包含 MSIE,網站伺服器端偵測恢復正常,版面與功能回復正確。

注意: 修改登錄影響所有使用 IE11 的應用程式 (含內嵌 WebBrowser 控制項),建議先在測試環境驗證。企業環境可透過群組原則部署。
Copyright © Windows教程網 All Rights Reserved