You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firefox与IE元素检查器差异:元素ID缺失问题咨询

Why That ID Only Shows Up in IE (and How to Fix Your Firefox Test)

Great question—this is a classic cross-browser quirk tied to how older browsers and legacy scripts behave. Let’s break this down clearly:

First: Yes, that ID is IE-specific (dynamically generated)

The wb-auto-12 ID you see in IE isn’t part of the page’s original HTML. Looking at the class names like wb-init and wb-details-inited, this element is part of the Government of Canada’s Web Experience Toolkit (WET) — a framework they use for their sites. Older versions of WET included fallback logic that dynamically added IDs to interactive components only in IE (to work around IE’s limited support for modern HTML features like <summary>/<details>).

In Firefox (and other modern browsers), this IE-specific fallback doesn’t run, so the ID never gets created. That means there’s no way to "get" this ID in Firefox—it simply doesn’t exist in that environment.

Cross-Browser Ways to Locate the Element

Instead of relying on the IE-only ID, use these reliable, consistent methods to target the button across both browsers:

  • CSS Selector with Classes: Combine the element type and its stable, original classes:
    summary.btn.btn-default.text-center
    
    This works everywhere because the classes are part of the page’s core code.
  • XPath by Text Content: Target the element directly using its visible text (use normalize-space to handle any hidden whitespace):
    //summary[normalize-space(text())='Report a problem or mistake on this page']
    
  • Narrow with Parent Context: If there are similar elements on the page, add a parent selector to be more precise (this button lives in the page footer):
    footer summary.btn.btn-default.text-center
    

All these approaches will work seamlessly across IE and Firefox, so you won’t have to depend on browser-specific dynamic IDs anymore.

内容的提问来源于stack exchange,提问作者Melodie Gauthier

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:33:55