HTMLIFrameElement.purgeHistory() 编辑
Warning: Removed in Firefox 65.
The purgeHistory()
method of the HTMLIFrameElement
interface is used to clear the browsing history associated with the browser <iframe>
. It only deletes history, not cookies or other stored information.
Note: To delete cookies for a Firefox OS app, you could call clearBrowserData()
on the actual app itself.
Syntax
There is a DOMRequest
version and a Promise
version:
var myDOMRequest = instanceOfHTMLIframeElement.purgeHistory();
instanceOfHTMLIframeElement.purgeHistory().then(function() { ... });
Returns
Either
- A
DOMRequest
object that returns anonsuccess
handler if the history is deleted, or anonerror
handler if not. - A
Promise
that resolves, with no parameters, if the history is deleted, or rejects if not.
Parameters
None.
Examples
var browser = document.querySelector('iframe');
var request = browser.purgeHistory();
request.onsuccess = function() {
console.log('History deleted!');
}
request.onerror = function() {
console.error(this.error.name);
}
var browser = document.querySelector('iframe');
browser.purgeHistory().then(function() {
console.log('History deleted!');
},
function(error) {
console.error(this.error.name);
});
Specification
Not part of any specification.
Browser compatibility
Supported since Firefox 47, in chrome code only. Removed completely in Firefox 65.
Unlikely ever to be supported in other browsers.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论