Android 2.x webview兼容注意事项
490 查看
不可使用 javascript 方法列表:
Element.prototype.classList
只能通过正则低效的操作 className Can I use
Element.prototype.dataset
只能通过 getAttribute
和 setAttribute
获取设置 data-*
属性 Can I use
Function.prototype.bind
可通过添加 polyfill
方式使用 MDN
html5 history
API 包括 history.pushState
、history.replaceStat
、popstate
都能使用
有问题的 css 声明列表
position: fixed
某些 webview 上元素会跟着手势滚动后再弹回到固定位置,如果是body
直接子节点则没有此问题,建议是不用 position:fixed
overflow: auto
和 overflow: scroll
, 不会实现可滚动元素,建议是只让body
去滚动,万不得已使用 iscroll
animation-fill-mode
在 android 2.3之前不被支持
需要 sdk 设置开启才能使用的方法
localStorage
API
alert
confirm