Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法match特殊域名 #306

Open
9268 opened this issue Aug 28, 2024 · 5 comments
Open

无法match特殊域名 #306

9268 opened this issue Aug 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@9268
Copy link

9268 commented Aug 28, 2024

// ==UserScript==
// @name         lvs
// @namespace    http://tampermonkey.net/
// @version      2024-08-28
// @description  hook lvs req
// @author       anyone
// @match        http://lvs.srv/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mioffice.cn
// @grant        unsafeWindow
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @run-at       document-start
// @run-at       context-menu
// @require https://scriptcat.org/lib/637/1.3.3/ajaxHooker.js
// ==/UserScript==

域名是lvs.srv,这个根理论上是不能解析的,但我们公司内是用他当做内网域名了,可以正常访问
同一脚本在tampermonkey v5.1.1测试是可以加载的,但猫猫不行,版本v0.16.5

日志上报错是下面这个

2024-08-28 15:33:09 url load error {"env":"background","component":"runtime","scriptId":8,"name":"lvs","error":"invalid url: lvs.srv"}

image

@CodFrm
Copy link
Member

CodFrm commented Aug 29, 2024

你确定你的match表达式是:// @match http://lvs.srv/*吗?看错误信息像是:lvs.srv,我这边测试没问题

QQ_1724896294937

@9268
Copy link
Author

9268 commented Aug 29, 2024

额, 确实,错误信息的 lvs.srv 是我手动在设置里加的,这个删掉之后依旧没法正常注入,请问如何排查,两边代码是一样的

@CodFrm
Copy link
Member

CodFrm commented Aug 29, 2024

@9268 哥哥新建一个空的脚本试试,只使用上面的userheader,应该是可以匹配的,这样的话,删除现有脚本重新安装一下试试呢?也有可能是设置的bug

@9268
Copy link
Author

9268 commented Aug 29, 2024

@CodFrm 新建了一个复制原脚本内容,成功加载了,这也太奇怪了。。

@CodFrm
Copy link
Member

CodFrm commented Aug 30, 2024

@9268 可能是自定义设置导致的问题

@CodFrm CodFrm added the bug Something isn't working label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants