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

分享一下怎么搜索 避开网站搜不出来的尴尬 #640

Open
lemondreamtobe opened this issue Aug 12, 2022 · 3 comments
Open

分享一下怎么搜索 避开网站搜不出来的尴尬 #640

lemondreamtobe opened this issue Aug 12, 2022 · 3 comments

Comments

@lemondreamtobe
Copy link

第一,直接访问https://api.cdnjs.com/libraries?search=jquery

第二,输入自己想要的包

image

第三,找到想要的地址之后,把里面的域名替换一下,这个接口里的地址应该是外网的 所以不能直接访问
https://cdn.staticfile.org/

这样就能拿到cdn地址了

@zinkt
Copy link

zinkt commented Aug 15, 2022

感谢

@yiyingcanfeng
Copy link

yiyingcanfeng commented Sep 19, 2022

关于主页搜索用不了的问题,可以用下面的油猴脚本解决

// ==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);
      })
    })
  }

})();

image

@wgf4242
Copy link

wgf4242 commented Sep 24, 2022

关于主页搜索用不了的问题,可以用下面的油猴脚本解决

现在包的版本也显示不出来。求优化

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

No branches or pull requests

4 participants