EyeDropper:open() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
语法
js
open()
open(options)
参数
options
可选-
一个用于传递
AbortSignal
信号的对象:signal
-
一个
AbortSignal
对象。当调用AbortSignal
的abort()
方法时,拾色器模式将被中止。
返回值
异常
在 Promise
被拒绝(rejected)时,不会抛出异常,而是返回一个错误对象。Promise 在以下两种情况下被拒绝:
- 当用户通过按下 Escape 键来取消拾色器模式时。
- 当通过作为参数传递给
open()
方法的AbortController
来中止拾色器模式时。
规范
Specification |
---|
EyeDropper API # dom-eyedropper-open |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
open |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
- 它属于
EyeDropper
接口。