# Web
# Flag
- https://www.iso.org (opens new window)
- https://www.itu.int (opens new window)
- RFC https://www.rfc-editor.org (opens new window)
- IETF https://tools.ietf.org (opens new window)
- IRTF https://irtf.org (opens new window)
- https://www.iab.org (opens new window)
- https://github.com/w3c (opens new window)
- WHATWG技术的标准 https://github.com/whatwg (opens new window)
- Web 孵化器 https://github.com/WICG (opens new window)
- https://github.com/immersive-web (opens new window)
- 规范测试套件 https://github.com/web-platform-tests (opens new window)
- Ecma国际技术委员会 https://github.com/search?q=ECMAScript (opens new window)
- https://www.ecma-international.org/technical-committees (opens new window)
- https://github.com/tc39 (opens new window)
- https://github.com/75team/tc39 (opens new window)
- https://github.com/TimothyGu/es-howto (opens new window)
- https://github.com/sirisian/ecmascript-types (opens new window)
- https://github.com/es-meta/esmeta (opens new window)
- https://github.com/ecmascript-daily (opens new window)
- https://github.com/JSCIG (opens new window)
- https://github.com/es-shims (opens new window)
- Promises/A+规范 https://github.com/promises-aplus (opens new window)
- Web 开发技术-MDN https://developer.mozilla.org/zh-CN/docs/Web (opens new window)
- HTTP标头分析 https://github.com/rfc-st/humble (opens new window)
- 跨域资源共享 https://github.com/monsur/enable-cors.org (opens new window)
- https://github.com/gpuweb (opens new window)
- https://github.com/webgpu (opens new window)
- https://github.com/screen-share (opens new window)
- https://github.com/WebAudio (opens new window)
- https://github.com/NOtherDev/whatwebcando (opens new window)
- https://github.com/webrtc (opens new window)
- https://github.com/riju/WebCamera (opens new window)
- https://github.com/hughfenghen/WebAV (opens new window)
- https://github.com/webusb (opens new window)
- OpenGL/WebGL/Vulkan https://github.com/KhronosGroup (opens new window)
- 时区数据库 https://www.iana.org/time-zones (opens new window)
- https://webdevelopmenthistory.com (opens new window)
- https://github.com/HTTPArchive (opens new window)
- 浏览器功能支持情况 https://github.com/Fyrd/caniuse (opens new window)
- 电量情况 https://github.com/deepesh-01/battery_indicator (opens new window)
- 代码提示 https://github.com/webhintio (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/DustinBrett/daedalOS (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)
- https://github.com/CavsZhouyou/Front-End-Interview-Notebook (opens new window)
- 网络如何运作 https://github.com/vasanthk/how-web-works (opens new window)
- 前端解决第三方图片防盗链的办法 - html referrer 访问图片资源403问题 (opens new window)
- Serverless——前端的3.0时代 (opens new window)
- 前端精读周刊 https://github.com/ascoders/weekly (opens new window)
- https://github.com/huangyangquang/Latest-technology-tracking (opens new window)
- https://jsbin.com (opens new window)
- f2ex.cn 各种前端资源 (opens new window)
- Web 3.0 通识课 (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/Uniswap (opens new window)
- https://github.com/4everland (opens new window)
- 点对点网络web3.0 https://github.com/ipfs (opens new window)
- https://github.com/web3j (opens new window)
- https://github.com/ensdomains (opens new window)
- https://github.com/ethereum (opens new window)
- Polygon https://github.com/maticnetwork (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)
- 运行代码 https://github.com/rameshvarun/blog-cells (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)
- https://www.vuepress.cn (opens new window)
- https://github.com/vuepress-theme-hope (opens new window)
- 静态编译Jekyll https://github.com/jekyll/jekyll (opens new window)
- 静态编译Docsite https://github.com/txd-team/docsite (opens new window)
- https://github.com/11ty/eleventy (opens new window)
- 运行时驱动 https://github.com/docsifyjs/docsify (opens new window)
- https://github.com/egoist/docute (opens new window)
- https://github.com/mx-space (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/squidfunk/mkdocs-material (opens new window)
- 简历 https://github.com/xaoxuu/resume-docs (opens new window)
- https://github.com/AmruthPillai/Reactive-Resume (opens new window)
- https://github.com/i5heu/Faultier-CV (opens new window)
- https://github.com/RylanBot/resume-json-pdf (opens new window)
- https://github.com/BingyanStudio/LapisCV (opens new window)
- 百科 https://github.com/Requarks/wiki (opens new window)
- https://github.com/phachon/mm-wiki (opens new window)
- https://github.com/tangly1024/NotionNext (opens new window)
- https://github.com/toeverything/AFFiNE (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://asciidoc.org (opens new window)
- https://sourceforge.net/projects/asciidoc (opens new window)
- https://gitlab.eclipse.org/eclipse-wg/asciidoc-wg (opens new window)
- https://github.com/asciidoctor (opens new window)
- https://github.com/asciidoc-py/asciidoc-py (opens new window)
- https://github.com/asciidocfx/AsciidocFX (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)
- https://github.com/apiaryio/api-blueprint (opens new window)
- https://github.com/asoul-sig/asouldocs (opens new window)
- Swift或Objective-C https://github.com/realm/jazzy (opens new window)
- Java https://github.com/Kapeli/javadocset (opens new window)
- https://github.com/MaxxtonGroup/microdocs (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/schn4ck/schnack (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/DongHY1/comments (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)
# CDN
- https://github.com/cdnjs (opens new window)
- https://github.com/mjackson/unpkg (opens new window)
unpkg.com/[email protected]/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
registry.yarnpkg.com
registry.nodejitsu.com
skimdb.npmjs.com/registry
registry.enpmjs.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
需要浏览器和后端同时支持, 后端设置以下请求头就可以开启 (opens new window)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的内容
# OPTIONS预检命令,预检命令通过时才发送请求 # 检查请求的类型是不是预检命令 if ($request_method = 'OPTIONS') { # 表示允许这个域跨域调用(客户端发送请求的域名和端口) # $http_origin动态获取请求客户端请求的域 不用*的原因是带cookie的请求不支持*号 add_header 'Access-Control-Allow-Origin' $http_origin; # Om nom nom cookies add_header 'Access-Control-Allow-Credentials' 'true'; # 指定允许跨域的方法,*代表所有 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; # Custom headers and headers various browsers *should* be OK with but aren't #add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; add_header 'Access-Control-Allow-Headers' $http_access_control_request_headers; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; # Tell client that this pre-flight info is valid for 20 days # 预检命令的缓存,如果不缓存每次会发送两次请求 add_header 'Access-Control-Max-Age' 1728000; #add_header 'Content-Type' 'text/plain charset=UTF-8'; #add_header 'Content-Length' 0; return 204; }
postMessage
可以实现跨文本档、多窗口(iframe间通信最完美的办法)、跨域消息传递websocket
HTML5的一个持久化的协议,它实现了浏览器与服务器的全双工通信,也是跨域的一种解决方案Nginx
反向代理(其他服务器应用也可),一般用于生产环境webpack-dev-server
使用NodeJS服务器中间件Express
代为获取数据,仅用于开发环境
CSS →