解决 jQuery 官方 CDN 无法访问的问题

Posted by sysin on 2020-12-02
Estimated Reading Time 2 Minutes
Words 611 In Total
更新日期:Wed Dec 02 2020 15:06:17 GMT+0800,阅读量:

请访问原文链接:解决 jQuery 官方 CDN 无法访问的问题,查看最新版。原创作品,转载请保留出处。

作者主页:sysin.org


无耻抄袭者 Yu Tao,请立遁!!!

今日访问某厂商官网查询 HCL,发现页面显示正常,点击和搜索都没有变化,通过浏览器调试工具发现,原来该网站直接调用了 jQuery 的官方 CDN https://code.jquery.com/,需要文明上网才能访问。

参照之前使用 Google Recaptcha 的方法,可以通过 Redirector 而无需文明上网来访问。

简介

Redirector is a browser add-on for Firefox, Chrome and Opera. The add-on lets you create redirects for specific webpages, e.g. always redirect http://bing.com to http://google.com.

Redirector 是一款浏览器插件(扩展),功能是重定向 URL。

下载地址

Firefox Redirector | Chrome Redirector | Opera Redirector | Source code

Microsoft Edge 直接使用 Chrom 应用商店。

Chrome 应用商店也是需要文明上网的 (sysin),点击这里 解决。

查询 jQuery 的替代 CDN

点击 这里,可以看到微软和 BootCDN 与 jQuery 官方 CDN 的 URL 格式一致,这里使用微软的 CDN。

创建规则

点击浏览器(Firefox、Chrome 或者 Edge)工具栏的 Redirector 图标,点击 “Edit Redirects”,在出现的页面点击 “Create new redirect”,分别新建两个规则如下:

规则一

redirect-01

规则二

redirect-02

直接导入规则

看着有点麻烦?直接导入我的规则即可。

将以下内容保存为 json 文件(xxx.json),在 Redirector 中点击 “Import”,浏览到该文件导入即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2020-12-02T02:51:22.249Z",
"redirects": [
{
"description": "jquery-to-ms-sysin",
"exampleUrl": "https://code.jquery.com/*",
"exampleResult": "https://ajax.aspnetcdn.com/ajax/jQuery/*",
"error": null,
"includePattern": "https://code.jquery.com/*",
"excludePattern": "https://code.jquery.com/ui/*",
"patternDesc": "",
"redirectUrl": "https://ajax.aspnetcdn.com/ajax/jQuery/$1",
"patternType": "W",
"processMatches": "noProcessing",
"disabled": false,
"grouped": false,
"appliesTo": [
"script"
]
},
{
"description": "jquery-ui-to-ms-sysin",
"exampleUrl": "https://code.jquery.com/ui/*",
"exampleResult": "https://ajax.aspnetcdn.com/ajax/jquery.ui/*",
"error": null,
"includePattern": "https://code.jquery.com/ui/*",
"excludePattern": "",
"patternDesc": "",
"redirectUrl": "https://ajax.aspnetcdn.com/ajax/jquery.ui/$1",
"patternType": "W",
"processMatches": "noProcessing",
"disabled": false,
"grouped": false,
"appliesTo": [
"stylesheet",
"script",
"image"
]
}
]
}

捐助本站 ❤️ Donate

点击访问官方网站


文章用于推荐和分享优秀的软件产品及其相关技术,所有软件默认提供官方原版(免费版或试用版),免费分享。对于部分产品笔者加入了自己的理解和分析,方便学习和测试使用。任何内容若侵犯了您的版权,请联系作者删除。如果您喜欢这篇文章或者觉得它对您有所帮助,或者发现有不当之处,欢迎您发表评论,也欢迎您分享这个网站,或者赞赏一下作者,谢谢!

支付宝赞赏 微信赞赏

赞赏一下


☑️ 评论恢复,欢迎留言❗️
敬请注册!点击 “登录” - “用户注册”(已知不支持 21.cn/189.cn 邮箱)。请勿使用联合登录(已关闭)