@vvfx/browser-upgrade
v0.0.6
Published
VVFX 项目浏览器升级提示页
Downloads
10
Readme
VVFX Browser Upgrade
VVFX 项目浏览器升级提示页
特性检测
filesystem: Modernizr Filesystem detection
使用
使用脚本的方案插入页面。
<script src="https://gw.alipayobjects.com/os/lib/vvfx/browser-upgrade/${packageVersion}/index.js"></script>
配置
在 script 上加入 data-xxx 属性进行配置。
可用配置:
- data-title
- data-subtitle
- data-download-chrome-text
- data-download-chrome-url
- data-download-chrome-icon
- data-download-firefox-text
- data-download-firefox-url
- data-download-firefox-icon
- data-download-edge-text
- data-download-edge-url
- data-download-edge-icon
默认配置:
<script
src="https://gw.alipayobjects.com/os/lib/vvfx/browser-upgrade/${packageVersion}/index.js"
data-title="当前浏览器不支持"
data-subtitle="为了获取最佳的使用体验,请升级浏览器"
data-download-chrome-text="下载 Chrome"
data-download-chrome-url="https://www.google.cn/chrome/index.html"
data-download-chrome-icon="https://mdn.alipayobjects.com/huamei_08cv20/afts/img/A*--rqQ6YLrvkAAAAAAAAAAAAADt-9AQ/original"
data-download-firefox-text="下载 Firefox"
data-download-firefox-url="https://www.firefox.com.cn/"
data-download-firefox-icon="https://mdn.alipayobjects.com/huamei_08cv20/afts/img/A*xoFoSoao_0UAAAAAAAAAAAAADt-9AQ/original"
data-download-edge-text="下载 Edge"
data-download-edge-url="https://www.microsoft.com/zh-cn/edge"
data-download-edge-icon="https://mdn.alipayobjects.com/huamei_08cv20/afts/img/A*kLwGS74yLcAAAAAAAAAAAAAADt-9AQ/original"
></script>
检查
import '@vvfx/browser-upgrade/check'
该模块的副作用会自动检查浏览器升级提示是否工作,如工作将阻塞后续代码的执行,需要放到工程代码启动前执行 check。