示例


{
  "scopes": {
    "file:///C:/app/": {},
    "file:": {},
    "": {}
  }
}

给定一个位于 file:///C:/app/bin/main.js 的文件,将按顺序检查以下范围:

  1. "file:///C:/app/bin/"

这决定了 "file:///C:/app/bin/" 中所有基于文件的资源的策略。 这不在策略的 "scopes" 字段中,将被跳过。 将此范围添加到策略将导致它在 "file:///C:/app/" 范围之前使用。

  1. "file:///C:/app/"

这决定了 "file:///C:/app/" 中所有基于文件的资源的策略。 这是在策略的 "scopes" 字段中,它将确定 file:///C:/app/bin/main.js 资源的策略。 如果范围有 "cascade": true,则任何关于资源的不满意查询都将委托给 file:///C:/app/bin/main.js"file:" 的下一个相关范围。

  1. "file:///C:/"

这决定了 "file:///C:/" 中所有基于文件的资源的策略。 这不在策略的 "scopes" 字段中,将被跳过。 除非 "file:///" 设置为级联或不在策略的 "scopes" 中,否则它不会用于 file:///C:/app/bin/main.js

  1. "file:///"

这决定了 localhost 上所有基于文件的资源的策略。 这不在策略的 "scopes" 字段中,将被跳过。 除非 "file:///" 设置为级联或不在策略的 "scopes" 中,否则它不会用于 file:///C:/app/bin/main.js

  1. "file:"

这决定了所有基于文件的资源的策略。 除非 "file:///" 设置为级联或不在策略的 "scopes" 中,否则它不会用于 file:///C:/app/bin/main.js

  1. ""

这决定了所有资源的策略。 除非 "file:" 设置为级联,否则它不会用于 file:///C:/app/bin/main.js

{
  "scopes": {
    "file:///C:/app/": {},
    "file:": {},
    "": {}
  }
}

Given a file located at file:///C:/app/bin/main.js, the following scopes would be checked in order:

  1. "file:///C:/app/bin/"

This determines the policy for all file based resources within "file:///C:/app/bin/". This is not in the "scopes" field of the policy and would be skipped. Adding this scope to the policy would cause it to be used prior to the "file:///C:/app/" scope.

  1. "file:///C:/app/"

This determines the policy for all file based resources within "file:///C:/app/". This is in the "scopes" field of the policy and it would determine the policy for the resource at file:///C:/app/bin/main.js. If the scope has "cascade": true, any unsatisfied queries about the resource would delegate to the next relevant scope for file:///C:/app/bin/main.js, "file:".

  1. "file:///C:/"

This determines the policy for all file based resources within "file:///C:/". This is not in the "scopes" field of the policy and would be skipped. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.

  1. "file:///"

This determines the policy for all file based resources on the localhost. This is not in the "scopes" field of the policy and would be skipped. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.

  1. "file:"

This determines the policy for all file based resources. It would not be used for file:///C:/app/bin/main.js unless "file:///" is set to cascade or is not in the "scopes" of the policy.

  1. ""

This determines the policy for all resources. It would not be used for file:///C:/app/bin/main.js unless "file:" is set to cascade.