-
Notifications
You must be signed in to change notification settings - Fork 520
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
staticfile首页无法搜索 #638
Comments
js.zip |
所以这个网站不维护了吗 这么多天未修复? |
不维护了? |
首页没法搜索js库了,没人修复吗? |
确实映射本地后可以使用 |
写了个油猴脚本,可以暂时解决一下搜索的问题 // ==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=jq
总是返回
The text was updated successfully, but these errors were encountered: