警告 : Removed in Firefox 65.

purgeHistory() 方法在 HTMLIFrameElement interface is used to clear the browsing history associated with the browser <iframe> . It only deletes history, not cookies or other stored information.

注意 : To delete cookies for a Firefox OS app, you could call clearBrowserData() on the actual app itself.

句法

DOMRequest version and a Promise version:

var myDOMRequest = instanceOfHTMLIframeElement.purgeHistory();
					
instanceOfHTMLIframeElement.purgeHistory().then(function() { ... });
					

返回

要么

  • A DOMRequest object that returns an onsuccess handler if the history is deleted, or an onerror handler if not.
  • A Promise that resolves, with no parameters, if the history is deleted, or rejects if not.

参数

None.

范例

DOMRequest :

var browser = document.querySelector('iframe');
var request = browser.purgeHistory();
request.onsuccess = function() {
  console.log('History deleted!');
}
request.onerror = function() {
  console.error(this.error.name);
}
					

Promise :

var browser = document.querySelector('iframe');

browser.purgeHistory().then(function() {
  console.log('History deleted!');
},
function(error) {
  console.error(this.error.name);
});

					

规范

Not part of any specification.

浏览器兼容性

Supported since Firefox 47, in chrome code only. Removed completely in Firefox 65.

Unlikely ever to be supported in other browsers.

另请参阅

元数据

  • 最后修改:
  1. 方法
    1. HTMLIFrameElement.addNextPaintListener()
    2. HTMLIFrameElement.clearMatch()
    3. HTMLIFrameElement.download()
    4. HTMLIFrameElement.executeScript()
    5. HTMLIFrameElement.findAll()
    6. HTMLIFrameElement.findNext()
    7. HTMLIFrameElement.getActive()
    8. HTMLIFrameElement.getCanGoBack()
    9. HTMLIFrameElement.getCanGoForward()
    10. HTMLIFrameElement.getContentDimensions()
    11. HTMLIFrameElement.getMainfest()
    12. HTMLIFrameElement.getMuted()
    13. HTMLIFrameElement.getScreenshot()
    14. HTMLIFrameElement.getStructuredData()
    15. HTMLIFrameElement.goBack()
    16. HTMLIFrameElement.goForward()
    17. HTMLIFrameElement.getVisible()
    18. HTMLIFrameElement.getVolume()
    19. HTMLIFrameElement.mute()
    20. HTMLIFrameElement.purgeHistory()
    21. HTMLIFrameElement.reload()
    22. HTMLIFrameElement.removeNextPaintListener()
    23. HTMLIFrameElement.sendMouseEvent()
    24. HTMLIFrameElement.sendTouchEvent()
    25. HTMLIFrameElement.setActive()
    26. HTMLIFrameElement.setInputMethodActive()
    27. HTMLIFrameElement.setNFCFocus()
    28. HTMLIFrameElement.setVisible()
    29. HTMLIFrameElement.setVolume()
    30. HTMLIFrameElement.stop()
    31. HTMLIFrameElement.unmute()
    32. HTMLIFrameElement.zoom()
  2. 事件
    1. mozbrowseractivitydone
    2. mozbrowserasyncscroll
    3. mozbrowseraudioplaybackchange
    4. mozbrowsercaretstatechanged
    5. mozbrowserclose
    6. mozbrowsercontextmenu
    7. mozbrowserdocumentfirstpaint
    8. mozbrowsererror
    9. mozbrowserfindchange
    10. mozbrowserfirstpaint
    11. mozbrowsericonchange
    12. mozbrowserloadend
    13. mozbrowserloadstart
    14. mozbrowserlocationchange
    15. mozbrowsermanifestchange
    16. mozbrowsermetachange
    17. mozbrowseropensearch
    18. mozbrowseropentab
    19. mozbrowseropenwindow
    20. mozbrowserresize
    21. mozbrowserscroll
    22. mozbrowserscrollareachanged
    23. mozbrowserscrollviewchange
    24. mozbrowsersecuritychange
    25. mozbrowserselectionstatechanged
    26. mozbrowsershowmodalprompt
    27. mozbrowsertitlechange
    28. mozbrowserusernameandpasswordrequired
    29. mozbrowservisibilitychange