UI Development Practices

Guidelines

Principles for developing for Chrome. These best practices center around ensuring features are implemented as efficiently as possible.

Content Area (UI in a Tab)

The UI that lives in the content area should be implemented with HTML technologies on desktop platforms. (Either web or native can be used for the content area UI on Android and iOS.) This HTML can be either WebUI or plain HTML and JS bundled with Chrome. It should work with no connection and lo-fi connections. The expectation is that the implementation does not contain polyfills, code that only executes for other browsers, or arcane Web development practices.

Non-Content Area (UI in Popups or in Chrome’s Chrome)

UI outside of the content area should be implemented using Views (in C++) for Windows/Linux/ChromeOS. Mac UI is done with Cocoa although work is progressing on porting Views to it as well. The expectation is that UI of this style is limited to small, transient windows with low-complexity UI. On Clank, this UI should be implemented using the Android View system.

Manipulating DOM on Arbitrary Pages

Some features need to inspect or modify the DOM of the current tab, which can be any arbitrary website. Blink's Web* C++ API is intentionally simple and limited to guide you to use it only for what is practical. When Blink’s  C++ API is impractical, use isolated world script injection. The script injected should be as lean as possible and should not contain any code that deals with other browsers (for example Closure).

Because script injection carries a runtime and memory cost, it is expected that it is driven by a user action that has an expectation of work. A good example is ‘translate’. If inspecting every page that the user might open is required, script injection is not recommended. For this case, consult with chrome-eng-review@ for an appropriate solution. For example, reader mode converted the triggering logic from script injection to native implementation.

Prototyping and Exploring the Solution Space

Experimenting can be accomplished with an extension. Non-confidential features can be published on the Chrome Web Store and installed manually for early testing. Confidential extensions can be enabled only for trusted testers so they are invisible to the public. Extensions can use content scripts to do script injection and can use page actions and browser actions to provide UI outside the content area. Extensions can also use NaCL, which has full access to the Pepper API.

Component extensions (i.e. extensions automatically installed into Chrome) are also a prototyping option, but should only be used if there is something needed that a regular extension cannot do. Extensions should strive to only execute on explicit user action and never on startup. Persistent background pages should be avoided. Event pages should only be used for infrequent items like push messaging, hardware events, alarms etc…, but not common events like navigation. If you need to do something that imposes a constant load or requires updating state on each navigation, consult the extensions team; they might be able to provide a declarative API so the job can be done with low impact. Failing that, consult with chrome-eng-review@ if you need to deviate from these guidelines.

UI Framework-1: UI Development Practices的更多相关文章

  1. Hybrid UI framework shootout: Ionic vs. Famo.us vs. F7 vs. OnsenUI

    1 Introduction In the past 2 years I’ve been working intensively on mobile applications, mostly hybr ...

  2. 00 - Vue3 UI Framework - 阅读辅助列表

    阅读列表 01 - Vue3 UI Framework - 开始 02 - Vue3 UI Framework - 顶部边栏 03 - Vue3 UI Framework - 首页 04 - Vue3 ...

  3. 【转】What is an entity system framework for game development?

    What is an entity system framework for game development? Posted on 19 January 2012 Last week I relea ...

  4. 创新高性能移动 UI 框架-Canvas UI 框架

    WebView 里无法获得的能力虽然是「体验增强」与「端基本能力」,但现都基本上有成熟解决方法.但后期的 UI 和 Layout 的性能反而是目前 Web 技术欠缺的.所以,无论是 Titanium ...

  5. Unity 游戏框架:UI 管理神器 UI Kit

    UI Kit 快速入门 首先我们来进行 UI Kit 的快速入门 制作一个界面的,步骤如下: 准备 生成代码 逻辑编写 运行 1. 准备 先创建一个场景 TestUIHomePanel. 删除 Hie ...

  6. iPhone/iPad/Android UI尺寸规范 UI尺寸规范,UI图标尺寸,UI界面尺寸,iPhone6尺寸,iPhone6 Plus尺寸,安卓尺寸,iOS尺寸

    iPhone/iPad/Android UI尺寸规范 UI尺寸规范,UI图标尺寸,UI界面尺寸,iPhone6尺寸,iPhone6 Plus尺寸,安卓尺寸,iOS尺寸 iPhone界面尺寸 设备 分辨 ...

  7. 学习通过Thread+Handler实现非UI线程更新UI组件

    [Android线程机制] 出于性能考虑,Android的UI操作并不是线程安全的,这就意味着如果有多个线程并发操作UI组件,可能导致线程安全问题.为了解决这个问题,Android制定了一条简单的规则 ...

  8. HTML5 UI框架Kendo UI Web中如何创建自定义组件(二)

    在前面的文章<HTML5 UI框架Kendo UI Web自定义组件(一)>中,对在Kendo UI Web中如何创建自定义组件作出了一些基础讲解,下面将继续前面的内容. 使用一个数据源 ...

  9. iframeWin For Easy UI. 为 Easy UI 扩展的支持IFrame插件

    iframeWin For Easy UI. 为 Easy UI 扩展的支持IFrame插件 在一个项目中用了Easy UI,但是发现里面的 Dialog .Window.Messager 弹窗都不支 ...

随机推荐

  1. nyoj--8--一种排序(排序,水题)

    一种排序 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复:还知道这个长方形的宽和长,编号.长.宽都是整数:现 ...

  2. Linux进程精讲

    进程相关概念 程序和进程 程序,是指编译好的二进制文件,在磁盘上,不占用系统资源(cpu.内存.打开的文件.设备.锁....) 进程,是一个抽象的概念,与操作系统原理联系紧密.进程是活跃的程序,占用系 ...

  3. sicily 1137 河床 (二分分治)

    <计算机算法设计与分析>啃书中... 有点看不进书,就来刷个水题吧,刚开始看错题了还. 注意:是所有测量点相差均不大于di而不是相邻两点... //1137.河床 #include < ...

  4. C#post调用接口并上传文件

    /// <summary> /// C#调用接口上传json数据,并且带文件上传 /// </summary> /// <param name="url&quo ...

  5. Ubuntu系统下安装Eclipse

    第一步:查看操作系统位数. 打开终端,输入file /sbin/init 可以看到笔者Ubuntu系统为32位,读者可以使用该命令获取自己机器上的操作系统位数. 这一步是最至关重要的一步,笔者机器处理 ...

  6. 51nod-1503 猪和回文 - 二维矩阵上的dp

    题目链接 一只猪走进了一个森林.很凑巧的是,这个森林的形状是长方形的,有n行,m列组成.我们把这个长方形的行从上到下标记为1到n,列从左到右标记为1到m.处于第r行第c列的格子用(r,c)表示. 刚开 ...

  7. CSS3新增的属性有哪些:

    CSS 用于控制网页的样式和布局. CSS3 是最新的 CSS 标准. CSS3新增了很多的属性,下面一起来分析一下新增的一些属性: 1.CSS3边框: border-radius:CSS3圆角边框. ...

  8. Django模版系统

    一.什么是模板? 只要是在html里面有模板语法就不是html文件了,这样的文件就叫做模板. 二.模板语法分类 一.模板语法之变量:语法为 {{ }}: 在 Django 模板中遍历复杂数据结构的关键 ...

  9. 【转载】python学习之 字符串前'r'的用法

    文章转载:https://www.cnblogs.com/cyiner/archive/2011/09/18/2180729.html 在打开文件的时候open(r'c:\....') 加r和不加'' ...

  10. pandas 7 合并 merge 水平合并,数据会变宽

    pd.merge( df1, df2, on=['key1', 'key2'], left_index=True, right_index=True, how=['left', 'right', 'o ...