非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
console
只读特性在
WorkerGlobalScope
interface returns a
控制台
object providing access to the browser console for the worker.
var consoleObj = self.console;
A
控制台
对象。
This property allows you to have access to a browser console for debugging purposes, inside a worker. So for example you could call
console.log('test');
inside a worker (which would basically be the equivalent of
self.console.log('test');
, as these are being called on the worker scope, which can be referenced with
WorkerGlobalScope.self
), to return a test message out to the browser console.
If you are calling
console.log()
从
DedicatedWorkerGlobalScope
or other worker scope that acts on a single loaded window, that tab's web console will receive the logs. However, If you are calling
console.log()
从
SharedWorkerGlobalScope
, the global browser console will receive the logs.
Not yet part of any specification.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
console
弃用
非标
|
Chrome 4 | Edge 12 |
Firefox
29
|
IE Yes | Opera Yes | Safari Yes | WebView Android 37 | Chrome Android Yes |
Firefox Android
29
|
Opera Android ? | Safari iOS ? | Samsung Internet Android Yes |
完整支持
兼容性未知
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
见实现注意事项。