Chrome Extension Development Manual·Known issues when migrating to Manifest V3

> Known issues when migrating to Manifest V3

Known issues when migrating to Manifest V3

Published on Friday, September 23, 2022 • Updated on Wednesday, May 10, 2023Published on Friday, September 23, 2022
· Updated on Wednesday, May 10, 2023

Extensions News Extensions News

Table of contents table of contents

  • Closing the platform gap
  • Manifest V3 frequently asked questions

December 9, 2022:The Manifest V2 deprecation timelines are under review and the experiments scheduled for early 2023 are being postponed. For more information, read the update in the chromium-extensions Google Group. December 9, 2022: The Manifest V2 deprecation timeline is under
review , experiments planned for early 2023 are being postponed. For more information, read the updates in the Chrome Extensions Google Group.

Recently, we announced changes to the Manifest V2 deprecation timeline, and while we remain firmly committed to Manifest V3 we acknowledge there is more work to do on our part. Recently, we announced changes to the Manifest V2
deprecation timeline, while we We remain firmly committed to Manifest V3, but we acknowledge that we have more work to do.


  • Before announcing a new timeline for deprecation, we will finish addressing prioritized platform gaps and close the critical bugs that are documented on this page. Critical errors logged on the page.

  • We will give developers time to build, guaranteeing at least 6 months between a timeline announcement and any experiments removing support for Manifest V2. There must be at least 6 months between.

# Closing the platform gap

Close the platform gap

We are committed to closing the following gaps before announcing a new Manifest V2 deprecation timeline: Before
announcing a new Manifest V2 deprecation timeline, we are committed to closing the following gaps:

  1. User Script support:Allow registering content scripts with arbitrary code by adding new functionality to the scripting API. (See our proposal for details.)
    User script support: Allow registering content scripts with arbitrary code by adding new functionality to the scripting API. (See our recommendations for details).

  2. Additional strong service worker keepalives for certain operations taking longer than five minutes.
    Additional strong service worker keepalives for certain operations taking longer than five minutes.

    Work in progress: Added in Chrome 116 for

    permissions.request()
    

    ,

    desktopCapture.chooseDesktopMedia()
    

    ,

    identity.launchWebAuthFlow()
    

    and

    management.uninstall()
    

    .Work
    in progress: In Chrome 116

    permissions.request()
    
    desktopCapture.chooseDesktopMedia()
    

    identity.launchWebAuthFlow()
    

    and

    management.uninstall()
    

    Add to.

  3. Increase the number of static and enabled rulesetsfor Declarative Net Request (DNR).
    Increase the number of static and enabled rule sets for Declarative Net Request (DNR).

  4. Extend Offscreen document functionalityto support more reasons for using an offscreen document.
    Extend the off-screen document feature to support more reasons for using an off-screen document.

    Work in progress: GEOLOCATIONadded in Chrome 116
    Work in progress: GEOLOCATIONAdded in Chrome 116

  5. Support File Handling API on ChromeOS as a replacement for ```
    chrome.fileBrowserHandler

    支持ChromeOS上的文件处理API作为替代。
    
    


These issues have been collected based on feedback from partners, bug reports, and developers . In addition to these, we will continue our ongoing work to address stability issues and improve overall performance. Feedback collected. Beyond that, we'll continue our ongoing work to address stability issues and improve overall performance.

The following issues have recently been addressed:
The following issues have recently been addressed:

  1. Improving support for the chrome.tabCapture API[Chrome 116]:
    Improving support for API [Chrome 116]:
    • Support calling getMediaStreamId()from a service worker.
      Support calling from a service worker.
    • Support obtaining a MediaStreamfrom a stream ID in an offscreen document.
      Support obtaining a from a stream ID in an offscreen document.
  2. Extending service worker lifetimeswhile there are active WebSocketconnections [Chrome 116].
    Extend service worker lifecycle while there are active connections [Chrome 116].

# Manifest V3 frequently asked questions

Manifest V3 FAQ

Q: Do we plan to support persistent Service Workers? 问:我们是否计划支持持久的Service Workers?
A:One of the key reasons for migrating from background scripts to service workers is the more memory efficient event-driven programming model which comes from the ephemeral nature of service workers. Consequently, we are not planning to support persistent service workers. However, to address the specific needs of extension developers, we are continuing to make many improvements to service workers. In particular:
A: A key reason for migrating from background scripts to service workers is the more efficient in-memory event-driven programming model that comes from service workers Transience. Therefore, we do not plan to support persistent service workers. However, we will continue to make many improvements to service workers in order to meet the specific needs of extension developers. in particular:

  • All extension events and API calls will extend the service worker lifetime
    .
  • Selected use cases such as native messaging will keep extensions service workers alive for longer than 5 min.
    Selected use cases such as native messaging will keep extensions service workers alive for longer than 5 min.

Q: Is there a way to access the DOM in service workers? 问:有没有办法在service worker中访问DOM?
A:We follow the approach taken by the Web Platform of not including DOM access in web workers (which includes service workers). To support use cases requiring background DOM access from service workers we've introduced the possibility to delegate background work to short-lived Offscreen documents which provide full DOM access.
A: We follow the approach taken by the web platform, which is to not include DOM access in web workers (including service workers). To support use cases that require background DOM access from service workers, we introduced the possibility to delegate background work to short-lived Offscreen documents that provide full DOM access.

Q: Will there be a way to support remote code in Manifest V3? 问:在Manifest V3中会有支持远程代码的方法吗?
A:To make Chrome Extensions more secure, we will continue to disallow executing arbitrary remotely hosted code in Chrome extensions. However, this does notmean we disallow all kinds of dynamic code execution. We still support different options of dynamically executing code in Chrome extensions:
Answer: To make Chrome extensions more secure, we will continue to disable the execution of arbitrary remotely hosted code in Chrome extensions. However, this does not mean that we do not allow all types of dynamic code execution. We still support different options for dynamically executing code in Chrome extensions:

  • Support for eval()in DevTools extensions
    Support for DevTools extensions
  • Support for user scripts.
    Support user scripts.
  • Executing remotely hosted code in sandboxed iframesExecuting
    remotely hosted code in sandboxed iframes
  • Remote hosted configuration files which can be interpreted at runtime in the extension package. However, possible execution paths need to be predetermined.
    Remote hosted configuration files which can be interpreted at runtime in the extension package. However, possible execution paths need to be determined in advance.

Q: My Manifest V2 extension relies on webRequestBlocking which is not supported in Manifest V3. How can I continue to provide the same functionality in Manifest V3? 问:我的Manifest V2扩展依赖于Manifest V3不支持的webRequestBlocking。如何在Manifest V3中继续提供相同的功能?
A: We are confident that most request blocking use cases can be solved with the new ```
declarativeNetRequest


 API , which has the added benefit of avoiding the performance overhead of interprocess communication, executing code on every request, or requiring an active extension process at the time of the request. However, for complex enterprise (or education) use cases, dynamic request blocking is still supported.  
答:我们相信,大多数请求阻塞用例都可以通过新的API解决,它具有避免进程间通信的性能开销、在每个请求上执行代码或在请求时需要活动扩展进程的额外好处。但是,对于复杂的企业(或教育)用例,仍然支持动态请求阻塞。

> `Did we miss something?` Please let us know.  
我们错过什么了吗请告诉我们。

> Updated on Wednesday, May 10, 2023 • Improve article

Guess you like

Origin blog.csdn.net/qq_35606400/article/details/132062028