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

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论