Skip to content

Design Notes #1

@harttle

Description

@harttle

这里描述 user-agent 的一些设计思路,有变更应该随时评论或更新:

  • 不复用其他工具,比如 fex-team/ua-device。主要考虑的原因是 1)非 AMD 入口,在搜索不可直接用(当然可以包装)2)接口风格与搜索业务使用方式不符(见下文)。
  • 主要提供断言,而不是返回浏览器信息。例如设计为 .isChrome() 而不是 .getBrowser() === 'chrome'。由于 1)在搜索业务中绝大多数场景是判定(是/否)某个浏览器,而非获取浏览器信息。2)目前搜索仍然是弱类型的JS源码,返回信息判等容易出错。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions