meta

1
2

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

link标签

因为页面切换主题网速慢会出现空白区域影响体验,就了解相关优化方法,下面做个整理

rel

  • preload优先加载(as必填的吧)
  • prefetch预加载(空闲时加载)
  • dns-prefetch使浏览器主动去执行域名解析的功能。
  • preconnect浏览器要建立一个连接,一般需要经过DNS查找,TCP三次握手和TLS协商(如果是https的话),这些过程都是需要相当的耗时的,所以preconnet,就是一项使浏览器能够预先建立一个连接,等真正需要加载资源的时候就能够直接请求了。
  • prerender不仅会加载资源,还会解执行页面,进行预渲染,但是这都是根据浏览器自身进行判断。
    1
    2
    3
    4
    5
    6
    <!-- 浏览器加载资源顺序如下 -->
    <link rel="prefetch" as="video" href="4.html">
    <link rel="stylesheet" href="2.css">
    <script src="3.html"></script>
    <link rel="prefetch" href="5.html">
    <link rel="preload" as="style" href="1.css">

as

  • audioAudio file.
  • documentAn HTML document intended to be embedded inside a <frame> or <iframe>.
  • embedA resource to be embedded inside an <embed> element.
  • fetchResource to be accessed by a fetch or XHR request, such as an ArrayBuffer or JSON file.
  • fontFont file.
  • imageImage file.
  • objectA resource to be embedded inside an <embed> element.
  • scriptJavaScript file.
  • styleStylesheet.
  • trackWebVTT file.
  • workerA JavaScript web worker or shared worker.
  • videoVideo file.

h5链接唤起App

1
2
3
4
5
6
7
8
<a href="mqq://">qq</a>
<a href="mqqapi://forward/url?souce=baidu.com">qq内置浏览器</a>
<a href="weixin://">微信</a>
<a href="TencentWeibo://">腾讯微博</a>
<a href="taobao://">淘宝</a>
<a href="alipay://">支付宝</a>
<a href="sinaweibo://">新浪微博</a>
<a href="snssdk1128://">抖音</a>

微信相关

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
微信 weixin://
!发起群聊 weixin://dl/groupchat
通讯录
!添加朋友 weixin://dl/add

上报日志 weixin://dl/log
故障修复 搜索 :recover
新的朋友 weixin://dl/recommendation

群聊 weixin://dl/groups
标签 weixin://dl/tags
公众号 weixin://dl/officialaccounts
发现
朋友圈 weixin://dl/moments
扫一扫 weixin://dl/scan
购物(京东) weixin://dl/shopping
游戏 weixin://dl/games

个人信息 weixin://dl/profile
名字 weixin://dl/setname
我的二维码 weixin://dl/myQRcode
我的地址 weixin://dl/myaddress
相册 weixin://dl/posts
收藏 weixin://dl/favorites
优惠券 weixin://dl/card
表情 weixin://dl/stickers
设置 weixin://dl/settings

QQ 号 weixin://dl/bindqq
手机号 weixin://dl/bindmobile
邮箱地址 weixin://dl/bindemail
帐号保护 weixin://dl/protection
新消息通知 weixin://dl/notifications

通讯录黑名单 weixin://dl/blacklist

不让他(她)看我的朋友圈 weixin://dl/hidemoments
不看他(她)的朋友圈 weixin://dl/blockmoments
通用 weixin://dl/general

多语言 weixin://dl/languages
字体大小 weixin://dl/textsize
我的表情 weixin://dl/stickersetting
朋友圈小视频 weixin://dl/sight
功能 weixin://dl/features

通讯录同步助手 weixin://dl/securityassistant
群发助手 weixin://dl/broadcastmessage
聊天记录迁移 weixin://dl/chathistory
清理微信存储空间 weixin://dl/clear
帮助与反馈
意见反馈 weixin://dl/help 或 weixin://dl/feedback
关于微信 weixin://dl/about
其他
隐藏入口 参数不明 第三方 Webview 接口 weixin://dl/businessWebview/link/
隐藏入口 参数不明 第三方游戏库接口 weixin://dl/businessGame/library/
隐藏入口 参数不明 第三方游戏详情接口 weixin://dl/businessGame/detail/
隐藏入口 参数不明 第三方支付接口 weixin://dl/businessPay/
隐藏入口 参数不明 第三方临时会话接口 weixin://dl/business/tempsession/ 或 weixin://dl/businessTempSession/
未知
weixin://dl/chat
weixin://dl/designeremoji
weixin://dl/login/common_view
weixin://dl/login/phone_view
weixin://dl/personalemoticon
weixin://private/
weixin://private/setresult/
weixin://dl/updatenewestversion
weixin://dl/wechatout
weixin://dl/wechatoutcoupon
隐藏入口

第三方公众号临时会话接口
weixin://dl/business参数 ticket
weixin://dl/business/?ticket=

缓存功能

好像被废弃掉了,慎用!

1
<html lang="zh-CN" manifest="/manifest/main.appcache">