-
Notifications
You must be signed in to change notification settings - Fork 521
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
分享一下怎么搜索 避开网站搜不出来的尴尬 #640
Comments
感谢 |
关于主页搜索用不了的问题,可以用下面的油猴脚本解决 // ==UserScript==
// @name staticfile搜索优化
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://staticfile.org*
// @icon http://staticfile.org/assets/images/logo.png
// @grant none
// ==/UserScript==
(function () {
'use strict';
var realFetch = "_rfetch";
window[realFetch] = window[realFetch] || fetch;
window.fetch = function (input, init = {}) {
if (input.startsWith('https://api.cdnjs.com/libraries/?')) {
input = input.replaceAll('https://api.cdnjs.com/libraries/?', 'https://api.cdnjs.com/libraries?');
}
return new Promise(function (resolve, reject) {
window[realFetch](input, init).then(res => {
const [progressStream, returnStream] = res.body.tee()
const origRes = new Response(
returnStream,
{
headers: res.headers,
status: res.status,
statusText: res.statusText
})
resolve(origRes)
}).catch(err => {
reject(err);
})
})
}
})(); |
现在包的版本也显示不出来。求优化 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第一,直接访问https://api.cdnjs.com/libraries?search=jquery
第二,输入自己想要的包
第三,找到想要的地址之后,把里面的域名替换一下,这个接口里的地址应该是外网的 所以不能直接访问
https://cdn.staticfile.org/
这样就能拿到cdn地址了
The text was updated successfully, but these errors were encountered: