搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Clear the "back/forward" history of a pinned tab?

  • 4 个回答
  • 1 人有此问题
  • 45 次查看
  • 最后回复者为 cor-el

more options

Hi all,

A few years ago 'delicene' posted this very question (https://support.mozilla.org/en-US/questions/847382) and 'cor-el' posted a useful answer, however, Firefox has changed a lot since this was posted and I have been unable to work this. Does anyone know of a way to achieve the very same trick today.

Many thanks

Chris

Hi all, A few years ago 'delicene' posted this very question (https://support.mozilla.org/en-US/questions/847382) and 'cor-el' posted a useful answer, however, Firefox has changed a lot since this was posted and I have been unable to work this. Does anyone know of a way to achieve the very same trick today. Many thanks Chris

被采纳的解决方案

That code should still work in the Browser Console (Firefox/Tools > Web Developer) that has replaced the Error console.

This will clear the tab history for all tabs and all windows and not for a specific tab. Also data about closed Tabs and Windows is removed (History > Recently Closed Tabs/Windows sections).

See onPurgeSessionHistory in resource:///modules/sessionstore/SessionStore.jsm


var os = Components.classes["@mozilla.org/observer-service;1"]
      .getService(Components.interfaces.nsIObserverService);
    os.notifyObservers(null, "browser:purge-session-history", "");
定位到答案原位置 👍 0

所有回复 (4)

more options

选择的解决方案

That code should still work in the Browser Console (Firefox/Tools > Web Developer) that has replaced the Error console.

This will clear the tab history for all tabs and all windows and not for a specific tab. Also data about closed Tabs and Windows is removed (History > Recently Closed Tabs/Windows sections).

See onPurgeSessionHistory in resource:///modules/sessionstore/SessionStore.jsm


var os = Components.classes["@mozilla.org/observer-service;1"]
      .getService(Components.interfaces.nsIObserverService);
    os.notifyObservers(null, "browser:purge-session-history", "");

由cor-el于修改

more options

I seem to be having a few issues here. Whilst the Browser Console starts, it does not contain the command line interpreter that I can see in the web console. It just appears as a pop out windows containing logging info.

However, even if I run the command in the Web Console i see an error:

TypeError: Components.classes is undefined The Components object is deprecated. It will soon be removed.

more options

Never mind. I see that the Console is disabled by default in Firefox 30. Enabling Chrome Debugging and running the command seem to have done the trick.

I had hoped that this would reduce the ridiculous memory consumed by Firefox, but it's still running at over 0.5GB - however, I have got this down from well over 1GB!!!

more options

Sorry. I forgot that you need to toggle the devtools.chrome.enabled pref to enable the command line. I had this issue as well a while back.

It is mentioned in the MDN article: