Skip to content

对@match规则的处理问题 #30

Closed

Description

@slightin

在tampermonkey中,@match “https://hostname” 规则仅会使脚本在该域名的主页运行,即pathname=="/"时运行
而在scriptcat中,@match “https://hostname” 规则会使脚本在该域名下的所有页面运行,和@match “https://hostname/*” 的效果相同

Activity

  1. added
    bug
    on Jan 17, 2022
  2. CodFrm commented on Jan 20, 2022

    @CodFrm
    Member

    测试了一下,并没有出现,能给出一个具体的网址和截图吗?

    // ==UserScript==
    // @name         Match test
    // @namespace    https://bbs.tampermonkey.net.cn/
    // @version      0.1.0
    // @description  try to take over the world!
    // @author       You
    // @match        https://bbs.tampermonkey.net.cn
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
    })();

    image

    image

  3. slightin commented on Jan 20, 2022

    @slightin
    Author

    出现问题的网址是“http://IP地址:端口号/“ 格式的,当把端口号设置为通配时就会出现上述情况
    网址为 http://27.188.65.169:9111/ 端口号为9111~9116 ,@match声明如下”http://27.188.65.169:*/“

  4. slightin commented on Jan 20, 2022

    @slightin
    Author
    // ==UserScript==
    // @name         New Userscript
    // @namespace    https://bbs.tampermonkey.net.cn/
    // @version      0.1.0
    // @description  try to take over the world!
    // @author       You
    // @match        http://27.188.65.169:*/
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
        alert("脚本被执行")
    })();
    

    image
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions