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

优化建议 #121

Open
hdtopku opened this issue Apr 11, 2022 · 6 comments
Open

优化建议 #121

hdtopku opened this issue Apr 11, 2022 · 6 comments

Comments

@hdtopku
Copy link

hdtopku commented Apr 11, 2022

  1. 像掘金这种,url编码或base64编码的,有好多%2,无法进行跳转,能否增加这种处理:
    https://link.juejin.cn/?target=https%3A%2F%2Fhub.fastgit.xyz%2Falibaba%2Fp3c%2Ftree%2Fmaster%2Fp3c-formatter
    我的替换规则是:
https://link\.juejin\.cn/\?target=http(s?)%3A%2F%2F(.*)

http$1://$2

结果跳转不了
2. 能否增加一个pinned issue,专门用来共享广大使用者的规则,每个人都可以分享或借鉴别人的规则

@jiacai2050
Copy link
Owner

  • 第一个可以在 sandbox 里面测试下,看看哪里出了问题
  • 第二个已经创建了。规则分享 #122

@inkroom
Copy link

inkroom commented Apr 20, 2022

  • 第一个可以在 sandbox 里面测试下,看看哪里出了问题

我尝试替换类似的url也是这样,sandbox里替换处理的结果就是url编码后的值,没有处理过。

网页上就是一点动静都没有

要替换的url是

https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Flists.fedoraproject.org%2Farchives%2Flist%2Fdevel%40lists.fedoraproject.org%2Fthread%2FJUJV6BEJAXK5LATTSWGRFZDIAVM7KN4J%2F

规则是:

    {
      "src": "https://www\.oschina\.net/action/GoToLink\?url=(.*)",
      "kind": "regexp",
      "dst": "$1",
      "enable": true
    }

sandbox里提示如下:

匹配成功!https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Flists.fedoraproject.org%2Farchives%2Flist%2Fdevel%40lists.fedoraproject.org%2Fthread%2FJUJV6BEJAXK5LATTSWGRFZDIAVM7KN4J%2F 被重定向到 https%3A%2F%2Flists.fedoraproject.org%2Farchives%2Flist%2Fdevel%40lists.fedoraproject.org%2Fthread%2FJUJV6BEJAXK5LATTSWGRFZDIAVM7KN4J%2F

@jiacai2050
Copy link
Owner

sandbox 有提示,说明规则没问题,那么大概率就是插件拿到的地址是没有 url encoding 的,用 encoding 之前的试试看?

@hdtopku
Copy link
Author

hdtopku commented Apr 20, 2022 via email

@hdtopku
Copy link
Author

hdtopku commented Apr 20, 2022

image

如图,其他插件有进行链接解码

@Lehmaning
Copy link
Contributor

Lehmaning commented Dec 6, 2022

  • 第一个可以在 sandbox 里面测试下,看看哪里出了问题

同样的问题。

  • 规则:^https://link\..*\..*/\?target=http(s?)(?:%3A|:)(?:%2F%2F|//)
  • 链接:https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2Frgripper%2Frusty-bomber

沙盒测试结果是https://github.com%2Frgripper%2Frusty-bomber,可能因为这个原因,我的 Firefox 没认为这是个有效的 URL,于是就没有重定向……预期结果应该是https://github.com/rgripper/rusty-bomber,然后正常重定向才对。另外,如果 URL 里的中文没有经过解码的话有的网站也只会显示 404,而不是正常的页面。

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

No branches or pull requests

4 participants