"DOMSnapshot.getSnapshot DEPRECATED"\n\nReturns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.\nPARAMETERS\ncomputedStyleWhitelist\narray[ string ]\nWhitelist of computed styles to return.\nincludeEventListeners\nboolean\nWhether or not to retrieve details of DOM listeners (default false).\nincludePaintOrder\nboolean\nWhether to determine and include the paint order index of LayoutTreeNodes (default false).\nincludeUserAgentShadowTree\nboolean\nWhether to include UA shadow tree in the snapshot (default false).\nRETURN OBJECT\ndomNodes\narray[ DOMNode ]\nThe nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.\nlayoutTreeNodes\narray[ LayoutTreeNode ]\nThe nodes in the layout tree.\ncomputedStyles\narray[ ComputedStyle ]\nWhitelisted ComputedStyle properties for each node in the layout tree.\n解释这个函数内容:这个函数是一个已弃用的函数,它返回一个文档快照,包括根节点的完整DOM树(包括iframes、模板内容和导入的文档),以及节点的布局和白名单计算样式信息。返回的DOM树中的Shadow DOM已被展开。\n\n参数:\n- computedStyleWhitelist:要返回的计算样式的白名单数组。\n- includeEventListeners:是否获取DOM监听器的详细信息(默认为false)。\n- includePaintOrder:是否确定并包含LayoutTreeNode的绘制顺序索引(默认为false)。\n- includeUserAgentShadowTree:是否在快照中包含UA影子树(默认为false)。\n\n返回对象:\n- domNodes:DOM树中的节点数组。索引为0的DOMNode对应根文档。\n- layoutTreeNodes:布局树中的节点数组。\n- computedStyles:布局树中每个节点的计算样式的白名单属性。


原文地址: https://www.cveoy.top/t/topic/pmxM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录