Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

汪沁然 / AmibaLight

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
主页面

主页面

Last edited by 汪沁然 Apr 25, 2018
Page history

index.html

主页面 index.html 是整个 阿米巴·轻 的入口,由于 ef.js 的存在,所以在这个文件中只有一些基础的引入。

Viewport

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0">

此条定义了页面支持响应式布局,禁止浏览器进行缩放

CSP 设定

阿米巴·轻 使用了最严格的 CSP 设定

  • 仅允许使用动态内容连接自身地址与消息队列服务器
  • 不允许框架网页
  • 仅允许从 data uri 加载图片
  • 仅允许从自身、 catnet 和 PolyfillIO 加载脚本
  • 仅允许从自身、内联、 catnet 和 GoogleApis 加载样式
  • 仅允许从自身、 GoogleFonts 和 catnet 加载字体
  • 不允许使用 Object 对象
  • 强制将 HTTP 请求提升为 HTTPS 即使 HTTPS 不可访问
  • 禁止加载 HTTP 内容
  • 对所有资源要求提供 SRI

CSP SRI

SRI 要求所有资源均需要校验签名,否则不予加载
使用下面的命令生成签名

curl https://example.com/xxx.js | openssl dgst -sha256 -binary | openssl enc -base64 -A

Body 定义

Body 定义中有一大段数字样的内容为侧边栏冰狮的 SVG 矢量图标

而后下方 script 则加载了所有需要的库

  Clone repository
  • Cdn
  • Css
  • Eft
  • Home
  • Mainjs
  • 主页面
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.