File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ translators:
13
13
related :
14
14
- title : 解释 nonce 设计目的
15
15
url : https://stackoverflow.com/questions/42922784/what-s-the-purpose-of-the-html-nonce-attribute-for-script-and-style-elements
16
- - title : 白名单的不安全性和内容安全政策的未来
16
+ - title : 白名单的不安全性和内容安全策略的未来
17
17
url : https://ai.google/research/pubs/pub45542
18
18
- title : 使用 CSP, Hash, Nonce 和 Report URI 锁定你的网站脚本
19
19
url : https://www.troyhunt.com/locking-down-your-website-scripts-with-csp-hashes-nonces-and-report-uri/
@@ -37,7 +37,7 @@ __webpack_nonce__ = 'c29tZSBjb29sIHN0cmluZyB3aWxsIHBvcCB1cCAxMjM=';
37
37
38
38
## 启用 CSP $#enabling-csp$
39
39
40
- 注意,默认情况下不启用 CSP。需要与文档一同发送相应的 ` CSP ` 响应头 ` < Content-Security-Policy` 或元标签 ` <meta http-equiv="Content-Security-Policy" ...> ` 以告知浏览器需要启用 CSP。以下是一个包含 CDN 白名单 URL 的 CSP 头部示例:
40
+ 注意,默认情况下不启用 CSP。需要与文档一同发送相应的 ` CSP ` 响应头 ` Content-Security-Policy ` 或元标签 ` <meta http-equiv="Content-Security-Policy" ...> ` 以告知浏览器需要启用 CSP。以下是一个包含 CDN 白名单 URL 的 CSP 头部示例:
41
41
42
42
``` html
43
43
Content-Security-Policy: default-src 'self'; script-src 'self'
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ translators:
15
15
16
16
T> 本指南继续沿用 [ 管理输出] ( /guides/output-management ) 中的代码示例。
17
17
18
- 渐进式网络应用程序(progressive web application - PWA),是一种可以提供类似于 native app(原生应用程序) 体验的 web app(网络应用程序)。PWA 可以用来做很多事。其中最重要的是,在** 离线(offline)** 时应用程序能够继续运行功能。这是通过使用名为 [ Service Workers] ( https://developers.google.com/web/fundamentals/primers/service-workers/ ) 的 web 技术来实现的。
18
+ 渐进式网络应用程序(progressive web application - PWA),是一种可以提供类似于 native app(原生应用程序) 体验的 web app(网络应用程序)。PWA 可以用来做很多事。其中最重要的是,在 ** 离线(offline)** 时应用程序能够继续运行功能。这是通过使用名为 [ Service Workers] ( https://developers.google.com/web/fundamentals/primers/service-workers/ ) 的 web 技术来实现的。
19
19
20
20
本章将重点介绍,如何为我们的应用程序添加离线体验。我们将使用名为 [ Workbox] ( https://github.com/GoogleChrome/workbox ) 的 Google 项目来实现此目的,该项目提供的工具可帮助我们更简单地为 web app 提供离线支持。
21
21
@@ -111,7 +111,7 @@ precache-manifest.b5ca1c555e832d6fbf9462efd29d27eb.js 268 bytes [emitt
111
111
...
112
112
```
113
113
114
- 现在你可以看到,生成了两个额外的文件:` service-worker.js ` 和名称冗长的 ` precache-manifest.b5ca1c555e832d6fbf9462efd29d27eb.js ` 。` service-worker.js ` 是 Service Worker 文件,` precache-manifest.b5ca1c555e832d6fbf9462efd29d27eb.js ` 是 ` service-worker.js ` 引用的文件,所以它也可以运行。你本地生成的文件可能会有所不同; 但是应该会有一个 ` service-worker.js ` 文件。
114
+ 现在你可以看到,生成了两个额外的文件:` service-worker.js ` 和名称冗长的 ` precache-manifest.b5ca1c555e832d6fbf9462efd29d27eb.js ` 。` service-worker.js ` 是 Service Worker 文件,` precache-manifest.b5ca1c555e832d6fbf9462efd29d27eb.js ` 是 ` service-worker.js ` 引用的文件,所以它也可以运行。你本地生成的文件可能会有所不同, 但是应该会有一个 ` service-worker.js ` 文件。
115
115
116
116
所以,值得高兴的是,我们现在已经创建出一个 Service Worker。接下来该做什么?
117
117
You can’t perform that action at this time.
0 commit comments