List all properties of window object?

后端 未结 3 891
慢半拍i
慢半拍i 2021-01-04 19:19

I\'m looking to (dynamically) obtain a list of HTML elements the browser is currently aware of, such as HTMLPreElement, HTMLSpanElement etc. These

3条回答
  •  礼貌的吻别
    2021-01-04 20:02

    In Firefox, it seems to be the behavior of elements that their global object is not added unless explicitly requested as a global variable or property. Perhaps Firefox lazy loads them into the environment so that they don't consume memory unless they're actually needed.

    It seems that they do not show up when simply requesting the keys of the global object via Object.getOwnPropertyNames unless they've first been explicitly referenced as described above.

    http://jsfiddle.net/mBAHm/

提交回复
热议问题