1 // Adds an href to the history
2 function webdeveloper_addToHistory(href
)
7 var globalHistory
= Components
.classes
["@mozilla.org/browser/global-history;1"].getService(Components
.interfaces
.nsIGlobalHistory
);
9 // If the href is not already in the history
10 if(!globalHistory
.isVisited(href
))
12 globalHistory
.addPage(href
);
18 function webdeveloper_removeAllFromHistory()
20 Components
.classes
["@mozilla.org/browser/global-history;2"].getService(Components
.interfaces
.nsIBrowserHistory
).removeAllPages();
23 // Removes an href from the history
24 function webdeveloper_removeFromHistory(href
)
29 var globalHistory
= Components
.classes
["@mozilla.org/browser/global-history;1"].getService(Components
.interfaces
.nsIGlobalHistory
);
31 // If the href is in the history
32 if(globalHistory
.isVisited(href
))
34 Components
.classes
["@mozilla.org/browser/global-history;2"].getService(Components
.interfaces
.nsIBrowserHistory
).removePage(Components
.classes
["@mozilla.org/network/io-service;1"].getService(Components
.interfaces
.nsIIOService
).newURI(href
, null, null));