Which URIs load where 编辑

Based initially on the page's URI scheme, the browser can decide whether to load a page in the chrome process or a content process. For some schemes, you can change the default behavior.

SchemeBehavior
about:

By default, about: pages are always loaded in the chrome process. However, when you register a new about: page, you can change this default.

Two new flags are defined in nsIAboutModule:

  • URI_CAN_LOAD_IN_CHILD: the page will be loaded in the same process as the browser that has loaded it.
  • URI_MUST_LOAD_IN_CHILD: the page will always be loaded in a child process.

To use one of these flags, return it from your implementation of getURIFlags in the code that registers the about: URI.

If you use these flags, you must register the about page in the framescript for each tab. If you do not set multiprocessCompatible to true in your install.rdf then shims will be used. But the e10s shims will be deprecated soon. Read more here - Bug 1257201.

chrome:

By default, chrome: pages are always loaded in the chrome process. However, when you register a new chrome: page, you can change this default.

Two new flags are defined in the chrome.manifest file:

  • remoteenabled: the page will be loaded in the same process as the browser that has loaded it.
  • remoterequired: the page will always be loaded in a child process.
file:

Always loaded in a content process.

Note: This does not mean file: URIs can be used freely by code in content processes. Sandboxing may blacklist particular directories and future changes may restrict file: URIs to a separate content process, isolated from regular web content. See bug 1187099 how this can affect addons attempting to load files from the profile directory.

resource:Always loaded in a content process.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:73 次

字数:2921

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文