Skip to content

Instantly share code, notes, and snippets.

@satyr
Created October 14, 2009 19:24
Show Gist options
  • Save satyr/210338 to your computer and use it in GitHub Desktop.
Save satyr/210338 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://landmarks/skin/default.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://landmarks/locale/landmarks.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<div id="landmarksmain" xmlns="http://www.w3.org/1999/xhtml"></div>
<script type="application/javascript">
<![CDATA[
var marks = <ul/>;
var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"]
.getService(Components.interfaces.nsINavHistoryService);
var options = historyService.getNewQueryOptions();
var query = historyService.getNewQuery();
var bookmarkService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
.getService(Components.interfaces.nsINavBookmarksService);
query.setFolders([bookmarkService.toolbarFolder], 1);
var result = historyService.executeQuery(query, options);
var {root} = result;
root.containerOpen = true;
for (var i = 0; i < root.childCount; i ++) {
var node = root.getChild(i);
marks.appendChild(<li><a href={node.uri}>{node.title}</a></li>);
}
root.containerOpen = false;
document.getElementById("landmarksmain").innerHTML = marks;
]]>
</script>
</overlay>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment