# Web
# Flag
- Web 开发技术-MDN https://developer.mozilla.org/zh-CN/docs/Web (opens new window)
- Web API https://developer.mozilla.org/zh-CN/docs/Web/API (opens new window)
- https://github.com/w3c (opens new window)
- W3C网页标准教程 http://www.w3chtml.com (opens new window)
- https://github.com/immersive-web (opens new window)
- IETF https://tools.ietf.org (opens new window)
- 代码提示 https://github.com/webhintio (opens new window)
- https://github.com/microsoft/Web-Dev-For-Beginners (opens new window)
- 开发人员设计资源 https://github.com/bradtraversy/design-resources-for-developers (opens new window)
- Web组件 https://github.com/webcomponents (opens new window)
- Web开源项目 https://github.com/bestofjs/bestofjs-webui (opens new window)
- https://github.com/the-benchmarker/website (opens new window)
- https://github.com/jobbole/awesome-design-cn (opens new window)
- https://github.com/junruchen/junruchen.github.io/wiki (opens new window)
- https://github.com/mathjax (opens new window)
- 前端知识点总结 https://github.com/zhaiyy/Web-front-end-knowledge-summary (opens new window)
- https://github.com/mqyqingfeng/Blog (opens new window)
- https://github.com/axuebin/articles (opens new window)
- https://github.com/LiangJunrong/document-library (opens new window)
- 前端面试 https://github.com/haizlin/fe-interview (opens new window)
- https://edu.aliyun.com/roadmap/frontend (opens new window)
- 前端解决第三方图片防盗链的办法 - html referrer 访问图片资源403问题 (opens new window)
- Serverless——前端的3.0时代 (opens new window)
- 前端精读周刊 https://github.com/ascoders/weekly (opens new window)
- https://jsbin.com (opens new window)
- f2ex.cn 各种前端资源 (opens new window)
- 网站测试 https://github.com/ycd/dstp (opens new window)
- web3.0 https://github.com/ChainSafe/web3.js (opens new window)
- https://github.com/ethereum (opens new window)
- 热加载 https://github.com/livereload (opens new window)
点击查看浏览器缓存
JS 浏览器缓存# 静态博客或文档
- https://github.com/topics/website (opens new window)
- https://github.com/topics/express (opens new window)
- https://github.com/topics/expressjs (opens new window)
- https://github.com/search?q=导航 (opens new window)
- https://github.com/topics/bookmark (opens new window)
- https://github.com/topics/site-navigation (opens new window)
- https://github.com/topics/nav (opens new window)
- https://github.com/topics/static-site (opens new window)
- https://github.com/topics/blog-engine (opens new window)
- https://github.com/topics/static-blog (opens new window)
- 不蒜子文章统计 (opens new window)
- 搜索 https://github.com/algolia/docsearch (opens new window)
- https://sourcegraph.com/search (opens new window)
- https://github.com/ekalinin/sitemap.js (opens new window)
- 网页加载进度 https://github.com/CodeByZach/pace (opens new window)
- 天气 https://weatherwidget.io (opens new window)
- 静态编译VuePress https://github.com/vuejs/vuepress (opens new window)
- https://github.com/vuepress/vuepress-next (opens new window)
- https://github.com/vuepress/awesome-vuepress (opens new window)
- https://github.com/search?q=vuepress-theme (opens new window)
- https://github.com/topics/vuepress-theme (opens new window)
- https://github.com/z3by/vuepress-tools (opens new window)
- https://github.com/vuejs/vitepress (opens new window)
- 静态编译Jekyll https://github.com/jekyll/jekyll (opens new window)
- 静态编译Docsite https://github.com/txd-team/docsite (opens new window)
- 运行时驱动Docsify https://github.com/docsifyjs/docsify (opens new window)
- 运行时驱动 https://github.com/egoist/docute (opens new window)
- 从仓库生成文档 https://github.com/readthedocs (opens new window)
- https://github.com/getgridea/gridea (opens new window)
- https://github.com/facebook/docusaurus (opens new window)
- 简历 https://github.com/xaoxuu/resume-docs (opens new window)
- https://github.com/AmruthPillai/Reactive-Resume (opens new window)
- 百科 https://github.com/Requarks/wiki (opens new window)
- https://github.com/phachon/mm-wiki (opens new window)
API接口文档管理
- https://siguso.com (opens new window)
- https://easydoc.net (opens new window)
- https://www.uedbox.com/share (opens new window)
- https://github.com/star7th/showdoc (opens new window)
- https://github.com/mylxsw/wizard (opens new window)
- https://github.com/doxygen/doxygen (opens new window)
- https://github.com/apidoc/apidoc (opens new window)
- https://github.com/jsdoc (opens new window)
- https://github.com/asciidoctor (opens new window)
- https://github.com/thx/rap2-delos (opens new window)
- https://github.com/YMFE/yapi (opens new window)
- https://github.com/wiztools/rest-client (opens new window)
- https://github.com/pedronauck/docz (opens new window)
- https://github.com/EhsanTang/ApiManager (opens new window)
- https://github.com/smart-doc-group (opens new window)
- Swift或Objective-C https://github.com/realm/jazzy (opens new window)
- Java https://github.com/Kapeli/javadocset (opens new window)
# 留言社区
- 注册一个新的 OAuth Application (opens new window)
- 问卷调查 https://www.typeform.com (opens new window)
- https://www.drift.com (opens new window)
留言评论
- https://github.com/topics/comments (opens new window)
- https://github.com/topics/comment-system (opens new window)
- https://github.com/MiniValine (opens new window)
- https://www.livere.com (opens new window)
- https://github.com/xCss/Valine (opens new window)
- https://github.com/djyde/cusdis (opens new window)
- 小部件 https://github.com/widgetbot-io (opens new window)
- https://chatra.com (opens new window)
- https://crisp.chat (opens new window)
- https://disqus.com (opens new window)
- https://github.com/gitalk (opens new window)
- https://github.com/meteorlxy/vssue (opens new window)
- https://github.com/imsun/gitment (opens new window)
- https://github.com/EZForever/gitment-mod (opens new window)
- https://github.com/utterance/utterances (opens new window)
- https://github.com/coralproject/talk (opens new window)
- https://github.com/vkuznecovas/mouthful (opens new window)
- https://github.com/cheng-kang/wildfire (opens new window)
- https://github.com/Ericwyn/Ponza (opens new window)
- https://github.com/aonemd/jazl (opens new window)
- https://github.com/art-deco/akashic.page (opens new window)
- https://github.com/aloud-comments (opens new window)
- https://github.com/MHuiG/ohhho (opens new window)
- https://github.com/imaegoo/twikoo (opens new window)
- https://github.com/Buzut/jamments (opens new window)
- https://github.com/sheychen290/comtodon (opens new window)
- https://github.com/qwqcode/Artalk (opens new window)
- https://github.com/patarapolw/aloud (opens new window)
- https://github.com/umputun/remark42 (opens new window)
- https://github.com/pozitron57/open-source-comments (opens new window)
讨论社区
- https://github.com/withspectrum (opens new window)
- https://github.com/discourse/discourse (opens new window)
- https://gitter.im (opens new window)
- https://github.com/ReplCustoms/ReplCustoms (opens new window)
# CloudFlare
- https://github.com/topics/cloudflare (opens new window)
- https://github.com/cloudflare (opens new window)
- 静态部署 https://pages.cloudflare.com (opens new window)
- 注意:在自定义域中和在DNS中如果配置了
@
,会导致Workers自定义域名无法访问,只配置www
即可 - https://www.cloudflare.com/zh-cn/analytics (opens new window)
- https://www.cloudflare.com/zh-cn/web-analytics (opens new window)
- https://www.cloudflare.com/zh-cn/ssl (opens new window)
- https://www.cloudflare.com/zh-cn/cdn (opens new window)
- https://github.com/BlueSkyXN/CFIP (opens new window)
- https://github.com/yuantuo666/cfip (opens new window)
- https://github.com/XIU2/CloudflareSpeedTest (opens new window)
# Workers
- https://workers.cloudflare.com (opens new window)
- https://github.com/cloudflare/wrangler (opens new window)
- https://github.com/search?q=Cloudflare+Workers (opens new window)
- https://github.com/topics/cloudflare-workers (opens new window)
- DNS:
AAAA 子域名 100::
或CNAME 子域名 项目名.子域.workers.dev
不论workers.dev子域是否关闭都可使用 - Cloudflare CNAME接入 https://github.com/ZE3kr/Cloudflare-CNAME-Setup (opens new window)
- https://subdomainfinder.c99.nl (opens new window) 搜索框输入
workers.dev
点击Start Scan
,再按Ctrl + f 输入github
- 用Cloudflare CDN 如何自定义节点(CF自选IP)/撸CloudFlare Pro (opens new window)
- https://github.com/netnr/workers (opens new window)
- https://github.com/aploium/zmirror (opens new window)
- 动态博客系统 https://github.com/kasuganosoras/cloudflare-worker-blog (opens new window)
- 个人导航网站 https://github.com/sleepwood/CF-Worker-Dir (opens new window)
- 一个极简风格的短网址转换 https://github.com/Closty/duanwangzhi (opens new window)
- 基于 Telegraf 框架的 Telegram Bot (opens new window)
- 使用CloudFlare Workers搭建网站状态监控 (opens new window)
代理
- https://github.com/search?q=reverse-proxy+cloudflare-workers (opens new window)
- https://github.com/search?q=proxy+cloudflare-workers (opens new window)
- https://github.com/topics/reverse-proxy (opens new window)
- https://github.com/EtherDream/jsproxy (opens new window)
- https://github.com/xiaoyang-liu-cs/booster.js (opens new window)
- https://github.com/netnr/workers (opens new window)
- https://github.com/ryanking13/cors (opens new window)
- https://github.com/AlejandroAkbal/Cloudflare-Worker-Cors-Proxy (opens new window)
# Warp
- https://github.com/ViRb3/wgcf (opens new window)
- https://github.com/navaneethkm004/warp-plus (opens new window)
- https://github.com/YG-tsj/Oracle-warp (opens new window)
# CDN
- https://github.com/cdnjs (opens new window)
- https://github.com/mjackson/unpkg (opens new window)
unpkg.com/react@16.0.0/umd/react.production.min.js
使用固定的版本号unpkg.com/react@^16/umd/react.production.min.js
使用语义化版本范围unpkg.com/react/umd/react.production.min.js
忽略版本和标签,使用最新版本unpkg.com/react
忽略了文件的路径,会302到最新文件URLunpkg.com/react/
在网址最后添加斜线,查看包内文件列表
- https://github.com/jsdelivr/jsdelivr (opens new window)
- https://www.jsdelivr.com (opens new window)
gcore.jsdelivr.net
fastly.jsdelivr.net
originfastly.jsdelivr.net
- 知乎 https://unpkg.zhimg.com (opens new window)
- 饿了么 https://npm.elemecdn.com (opens new window)
- https://www.bootcdn.cn (opens new window)
- https://github.com/staticfile (opens new window)
- https://cdn.baomitu.com (opens new window)
- https://www.skypack.dev (opens new window)
- https://developers.google.com/speed/libraries (opens new window)
- https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview (opens new window)
- 前端JS/CSS静态资源公共库免费CDN加速汇总 (opens new window)
fonts.gstatic.com fonts-gstatic.proxy.ustclug.org
fonts.gstatic.com gstatic.loli.net
fonts.gstatic.com gapis.geekzu.org/g-fonts
fonts.googleapis.com fonts.proxy.ustclug.org
fonts.googleapis.com fonts.loli.net
fonts.googleapis.com fonts.geekzu.org
ajax.googleapis.com ajax.proxy.ustclug.org
ajax.googleapis.com ajax.loli.net
ajax.googleapis.com gapis.geekzu.org/ajax
registry-1.docker.io docker.mirrors.ustc.edu.cn
packages.elastic.co elastic.proxy.ustclug.org
ppa.launchpad.net launchpad.proxy.ustclug.org
archive.cloudera.com/cdh5/ cloudera.proxy.ustclug.org/cdh5/
downloads.lede-project.org lede.proxy.ustclug.org
downloads.openwrt.org openwrt.proxy.ustclug.org
registry.npmjs.org npmreg.proxy.ustclug.org
www.npmjs.com npm.proxy.ustclug.org
themes.googleusercontent.com google-themes.proxy.ustclug.org
themes.googleusercontent.com themes.loli.net
themes.googleusercontent.com gapis.geekzu.org/g-themes
secure.gravatar.com gravatar.proxy.ustclug.org
secure.gravatar.com gravatar.loli.net
secure.gravatar.com/avatar sdn.geekzu.org/avatar
www.gravatar.com/avatar fdn.geekzu.org/avatar
[0-2].gravatar.com/avatar fdn.geekzu.org/avatar
cdnjs.cloudflare.com cdnjs.loli.net
# 面包屑导航
面包屑导航(BreadcrumbNavigation),这个概念名词来自一段童话故事“汉塞尔和格莱特”他们在森林里玩耍迷了路, 于是用一路撒面包屑的方式找到了出去的路。所以面包屑导航的作用是告诉访问者他们目前所在网站的位置以及如何返回上一级页面
面包屑导航(BreadcrumbNavigation)的作用及影响,让用户了解目前所在的位置,以及当前页面在整个网站中所在的位置; 体现了网站的架构层级;提高了用户体验;减少返回到上一级页面的操作;不用常常占用屏幕空间;降低跳出率; 有利于蜘蛛对网站的抓取;提供返回各个曾记得快速入口;有利于网站内链的建设。
注意:不管事次导航还是面包屑导航我们都要记住一点,不要堆砌关键词来放在导航栏上面。 关键词一定要自然分布,结合面包屑的导航让用户体验更好,页面更友好与搜索引擎也更友好。
# xpath和css选择器
- CSS选择器 - 学习 Web 开发 | MDN (opens new window)
- CSS 选择器 - CSS(层叠样式表) | MDN (opens new window)
- XPath | MDN (opens new window)
- Introduction to using XPath in JavaScript - JavaScript | MDN (opens new window)
Chrome
打开网页F12
后下面的调试工具出来后点击Elements
左边的那个框框里的鼠标箭头 (或者按Ctrl + Shift + C), 然后网页会变成蓝色,到网页点击自己要选择的区域,接下来就会自动跳到Elements
对应的位置, 在HTML
的标签上点击鼠标右键->Copy
->COpy selector
或者xpath
,就能复制选择器了。
document.querySelector("body");// 返回文档中匹配指定css选择器的第一个元素
document.querySelectorAll("body");
document.getElementById("id");
document.getElementsByClassName("name");
document.getElementsByName("body");// 返回文档中name属性为指定值的元素
document.getElementsByTagName("a");// 返回文档中指定标签的元素
Xpath基本语法
表达式 | 描述 |
---|---|
nodename | 选取此节点的所有子节点 |
/ | 从当前节点选取直接子节点 |
// | 从当前节点选取子孙节点 |
. | 选取当前节点 |
.. | 选取当前节点的父节点 |
@ | 选取属性 |
* | 选取具有给定属性的所有元素 |
[@attrib] | 选取给定属性具有给定值的所有元素 |
[@attrib='value'] | 选取所有具有指定元素的直接子节点 |
| | 选取两个节点,左右两个 |
book[1] | 选取第一个book元素 |
//li[contains(@attrib,value)] | 属于模糊定位。 |
//li[text()='xxx'] | 选取li标签中的值为xxx的元素 |
//li[last()='xxx'] | 选取li标签中的值为xxx的最后一个元素 |
//li/text() | 选取li标签下的文本内容 |
Xpath定位和Selector定位的区别
定位方式 | Xpath | Css Selector |
---|---|---|
find_element_by_id("id值") | //*[@id="id值"] | #id值 |
find_element_by_name("name值") | //*[@name="name值"] | [name="name值"] |
find_element_by_class_name("class name") | class name | .class name |
find_element_by_tag_name("标签名") | //标签名 | 标签名 |
find_element_by_link_text("链接文字") | //a[text()="链接文字"] | 不支持 |
find_element_by_partial_link_text("部分链接文字") | //a[contains(text(),"部分链接文字")] | 不支持 |
Target | CSS 3 | XPath |
---|---|---|
所有元素 | * | //* |
所有的P元素 | p | //p |
所有的p元素的子元素 | p > * | //p/* |
根据ID获取元素 | /转义/#id | //*[@id= ‘id’] |
根据Class获取元素 | .class | //*[contains(@class, ‘class’)] |
拥有某个属性的元素 | *[title] | //*[@title] |
所有P元素的第一个子元素 | p > *:first-child | //p/*[0] |
所有拥有子元素a的P元素 | 无法实现 | //p[a] |
下一个兄弟元素 | P + * | //p/following-sibling:😗[0] |
# 跨域/跨源
浏览器的同源策略
同源策略是一个重要的安全策略,它用于限制一个origin的文档或者它加载的脚本如何能与另一个源的资源进行交互。它能帮助阻隔恶意文档,减少可能被攻击的媒介。
如果两个URL的protocol(协议,比如http协议,https协议)、port (端口号)和 host(主机,域名或IP部分) 都相同的话, 则这两个 URL 是同源。这个方案也被称为
协议/主机/端口元组
,或者直接是元组
。也就是说如果不满足以上3个条件中的任意一个,则被视为跨域.
解决跨域问题的几种方式
JSONP
凡是拥有src
属性的标签都不受同源策略限制, 缺点是只支持GET请求CORS
需要浏览器和后端同时支持, 后端设置以下请求头就可以开启Access-Control-Allow-Origin
如果值为*
表示允许任何域名的访问Access-Control-Allow-Methods
表明服务器允许客户端使用的请求方法Access-Control-Allow-Headers
表明服务器允许请求中携带的头部字段Access-Control-Max-Age
表明响应的有效时间。在有效时间内,浏览器无须为同一请求再次发起预检请求Access-Control-Expose-Headers
服务器允许浏览器访问的头信息白名单Access-Control-Allow-Credentials
指定了当浏览器的credentials设置为true时是否允许浏览器读取response的内容
postMessage
可以实现跨文本档、多窗口(iframe间通信最完美的办法)、跨域消息传递websocket
HTML5的一个持久化的协议,它实现了浏览器与服务器的全双工通信,也是跨域的一种解决方案Nginx
反向代理(其他服务器应用也可),一般用于生产环境webpack-dev-server
使用NodeJS服务器中间件Express
代为获取数据,仅用于开发环境- https://github.com/webpack/webpack-dev-server (opens new window)
- https://github.com/webpack/webpack-dev-middleware (opens new window)
- https://github.com/chimurai/http-proxy-middleware (opens new window)
- https://github.com/http-party/node-http-proxy (opens new window)
- https://github.com/expressjs/express (opens new window)
CSS →