• Skip to main content
  • Skip to search
  • Skip to select language

Learn front-end development with high quality, interactive courses from Scrimba. Enroll now!

MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Accessibility

      Build web projects usable for all

    • Web Technology

      Web technology reference for developers

  • Learn
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Curriculum New
  • Blog
    • Playground

      Write, test and share your code

    • HTTP Observatory

      Scan a website for free

    • AI Help

      Get real-time assistance and support

  1. Mozilla
  2. 附加组件
  3. 浏览器扩展
  4. API
  5. dom
    • Is this useful?
    • English (US)
    • Deutsch

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

在本文中

  • 函数
  • 浏览器兼容性
  1. 浏览器扩展
  2. 开始
    1. 扩展是什么?
    2. 你的第一个扩展
    3. 你的第二个 WebExtension
    4. 扩展剖析
    5. 扩展示例
    6. 下一步是什么?
  3. 概念
    1. API
    2. 内容脚本
    3. Background scripts
    4. 匹配模式
    5. Work with files
    6. 国际化
    7. Content Security Policy
    8. 与本地应用通信
    9. 原生应用清单
    10. 用户操作
    11. Differences between API implementations
    12. Chrome 不兼容情况
  4. 用户界面
    1. Toolbar button
    2. 地址栏按钮
    3. Sidebars
    4. Context menu items
    5. Options page
    6. Extension pages
    7. 通知
    8. Address bar suggestions
    9. devtools panels
    10. Browser styles
    11. Popups
  5. 怎么做
    1. 拦截 HTTP 请求
    2. 修改 web 页面
    3. 注入外部内容
    4. Share objects with page scripts
    5. Add a button to the toolbar
    6. 实现一个设置页面
    7. 使用 Tabs API
    8. Work with the Bookmarks API
    9. Work with the Cookies API
    10. Work with contextual identities
    11. Interact with the clipboard
    12. 扩展开发人员工具
    13. 构建一个跨浏览器的扩展程序
  6. JavaScript API
    1. JavaScript API 的浏览器支持
    2. action
    3. alarms
    4. bookmarks
    5. browserAction
    6. browserSettings
    7. browsingData
    8. captivePortal
    9. clipboard
    10. commands
    11. contentScripts
    12. contextualIdentities
    13. cookies
    14. declarativeNetRequest
    15. devtools
    16. dns
    17. dom
      1. 方法
        1. openOrClosedShadowRoot()
    18. downloads
    19. events
    20. extension
    21. extensionTypes
    22. find
    23. history
    24. i18n
    25. identity
    26. idle
    27. management
    28. menus
    29. notifications
    30. omnibox
    31. pageAction
    32. permissions
    33. pkcs11
    34. privacy
    35. proxy
    36. runtime
    37. scripting
    38. search
    39. sessions
    40. sidebarAction
    41. storage
    42. tabs
    43. theme
    44. topSites
    45. types
    46. userScripts
    47. userScripts (Legacy)
    48. webNavigation
    49. webRequest
    50. windows
  7. 清单键
    1. action
    2. author
    3. 后台 - background
    4. browser_action
    5. browser_specific_settings
    6. chrome_settings_overrides
    7. chrome_url_overrides
    8. commands
    9. content_scripts
    10. content_security_policy
    11. declarative_net_request
    12. default_locale
    13. description
    14. developer
    15. devtools_page
    16. dictionaries
    17. externally_connectable
    18. homepage_url
    19. host_permissions
    20. icons
    21. incognito
    22. manifest_version
    23. 名称 - name
    24. offline_enabled 已弃用
    25. omnibox
    26. optional_host_permissions
    27. optional_permissions
    28. options_page
    29. options_ui
    30. page_action
    31. 权限 - permissions
    32. protocol_handlers
    33. short_name
    34. sidebar_action
    35. storage
    36. theme
    37. theme_experiment
    38. user_scripts
    39. version
    40. version_name
    41. web_accessible_resources
  8. Extension Workshop
    1. Develop
    2. Publish
    3. Manage
    4. Enterprise
  9. 联系我们
  10. 渠道
    1. 附加组件博客
    2. 附加组件论坛
    3. 附加组件聊天

在本文中

  • 函数
  • 浏览器兼容性

dom

访问仅特殊扩展程序可用的 DOM 特性。

函数

dom.openOrClosedShadowRoot()

获取指定元素的开放或封闭的影子(shadow)DOM。如果影子 DOM 未附加到该元素,则返回 null。

浏览器兼容性

Help improve MDN

Learn how to contribute.

This page was last modified on 2024年6月15日 by MDN contributors.

View this page on GitHub • Report a problem with this content
MDN logo

Your blueprint for a better internet.

  • MDN on Bluesky
  • MDN on Mastodon
  • MDN on X (formerly Twitter)
  • MDN on GitHub
  • MDN Blog RSS Feed

MDN

  • About
  • Blog
  • Careers
  • Advertise with us

Support

  • Product help
  • Report an issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Hacks Blog
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2025 by individual mozilla.org contributors. Content available under a Creative Commons license.