DeprecationReportBody: anticipatedRemoval 屬性
注意:此功能在 Web Workers 中可用。
DeprecationReportBody 介面的只讀屬性 anticipatedRemoval 返回將在哪個瀏覽器版本中移除該功能的釋出日期。此值可用於確定警告的優先順序。如果此屬性返回 null(因為日期未知),則應將此棄用視為低優先順序。
值
一個 Date 物件,如果日期未知則為 null。
示例
在此示例中,我們建立一個新的 ReportingObserver 來觀察棄用報告,然後將 anticipatedRemoval 的值列印到控制檯。
js
let options = {
types: ["deprecation"],
buffered: true,
};
let observer = new ReportingObserver((reports, observer) => {
let firstReport = reports[0];
console.log(firstReport.type); // deprecation
console.log(firstReport.body.anticipatedRemoval);
}, options);
規範
| 規範 |
|---|
| 棄用報告 # dom-deprecationreportbody-anticipatedremoval |
瀏覽器相容性
載入中…