V2EX  ›  英汉词典

Font-src

定义 Definition

font-src:内容安全策略(CSP, Content Security Policy)中的一条指令,用来规定网页允许从哪些来源加载字体资源(如 .woff2.woff.ttf 等)。它通常出现在 Content-Security-Policy HTTP 响应头或 <meta http-equiv="Content-Security-Policy"> 中。(也可用于限制 data:https: 等来源;不同浏览器与规范版本对细节支持略有差异。)

发音 Pronunciation (IPA)

/ˈfɑːnt sɝːs/

例句 Examples

The site uses font-src 'self' to load fonts only from its own domain.
该网站使用 font-src 'self' 让字体只能从自身域名加载。

To fix the console error, we updated the policy to font-src 'self' https://fonts.gstatic.com so the page can use Google-hosted fonts securely.
为了解决控制台报错,我们把策略改为 font-src 'self' https://fonts.gstatic.com,让页面能在更安全的前提下使用托管在 Google 的字体。

词源 Etymology

font-src 是由 font(字体)+ src(source 的缩写,来源)组合而成的技术写法,属于 CSP 指令命名风格(如 script-srcimg-src)。其中连字符 - 用于把“资源类型”和“来源限制”连接成一个可读的配置项名称。

相关词 Related Words

作品与资料中的用例 Notable Works

  • W3C Candidate Recommendation: Content Security Policy Level 3(规范文本中列出并解释 font-src 等指令)
  • MDN Web Docs: Content-Security-Policy — font-src(面向开发者的权威参考与示例)
  • OWASP Cheat Sheet Series: Content Security Policy(安全最佳实践中常提及字体等资源的来源限制)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1110 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 23:43 · PVG 07:43 · LAX 16:43 · JFK 19:43
♥ Do have faith in what you're doing.