<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 模式匹配 [內容腳本](content_scripts.html)可以作用到模式匹配定義好的URL集合上. 你能對manifest文件的內容腳本段的部分進行一個或多個模式匹配操作. 這里描述模式匹配語法 — 當你指定內容腳本將影響哪些URL時你需要遵循的規則. 任意一個模式匹配本質上都是一個以認可的協議(例如:http, https, file, ftp 或者 chrome-extension)開頭的URL,只是URL你可以包含"*"字符. 這里有一種特殊的模式匹配&lt;all_urls&gt;,它表示所有已認可的協議開頭的URL都被匹配. 每個模式匹配都由以下三部分構成:&lt;/all_urls&gt; * _協議(scheme)_— 例如,http or file or* **注意:**file協議不是缺省的(訪問文件時可能需要明確指明使用file協議). 用戶可以訪問擴展管理頁面或者設置頁面來查看每個擴展獨立的file協議設置. * _域名(host)_— 例如,www.google.com或者*.google.com或者*; 如果使用file協議, 這里就不需要_域名_部分 * _路徑(path)_— 例如,/*,/foo*, 或者/foo/bar 下邊列出了基本語法: ``` _<url-pattern>_ := _<scheme>_://_<host>__<path>_ _<scheme>_ := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-extension' _<host>_ := '*' | '*.' _<除 '/' 和 '*' 外的其它任意字符>_+ _<path>_ := '/' _<任意字符>_ ``` '*'的含意依賴于它是出現在_協議_,_域名_, 或者_路徑_中的那個部分. 如果_協議_部分是×, 那么它表示匹配以http和https協議開頭的URL. 如果_域名_部分是×, 那么它表示匹配任何域名. 如果_域名_部分是*._域名_, 那么它表示匹配該域名及任何該域名下的子域名. 而在_路徑_部分,每個'*'表示0個或多個字符. 下面的表展示了一些合法的模式匹配. | 模式匹配 | 含意 | 能夠匹配上的URL例子 | | --- | --- | --- | | http://*/* | 匹配任何http協議的URL | http://www.google.com/ http://example.org/foo/bar.html | | http://*/foo* | 匹配任何使用http協議的任何域名下,只要以/foo開頭的URL | http://example.com/foo/bar.html http://www.google.com/foo | | https://*.google.com/foo*bar | 匹配任何使用https協議的google.com域名或其下子域名(例如 www.google.com, docs.google.com, 或者 google.com), 只要路徑是以/foo開頭,以bar結尾的URL | http://www.google.com/foo/baz/bar http://docs.google.com/foobar | | http://example.org/foo/bar.html | 匹配指定的URL | http://example.org/foo/bar.html | | file:///foo* | 匹配以/foo開頭的任意本地文件 | file:///foo/bar.html file:///foo | | http://127.0.0.1/* | 匹配任意以http協議的主機ip是127.0.0.1的URL | http://127.0.0.1/ http://127.0.0.1/foo/bar.html | | *://mail.google.com/* | 匹配任意以http://mail.google.com或者https://mail.google.com開頭的URL. | http://mail.google.com/foo/baz/bar https://mail.google.com/foobar | | &lt;all_urls&gt;&lt;/all_urls&gt; | 匹配所有認可的協議的URL. (參看這一段開頭的認可協議列表,里邊包含了所有認可的協議.) | http://example.org/foo/bar.html file:///bar/baz.html | 這里展示一些_不合法_的模式匹配的例子: | 錯誤的模式匹配 | 錯誤原因 | | --- | --- | | http://www.google.com | 沒有說明_路徑_ | | http://*foo/bar | 在_域名_部分使用'*'時,'*'后邊只能是'.' 或者 '/' | | http://foo.*.bar/baz | 如果'*'出現在_host_部分時, '*'只能出現在開頭 | | http:/bar | 少寫了_協議_分隔符("/" 應該是"//") | | foo://* | 無效的_協議_ |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看