rem: bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService); if ((title == null) || (title == "")) { title = url; } bmks.AddBookmark(url, title, bmks.BOOKMARK_DEFAULT_TYPE, docCharset); debug("BrowserAddBookmark: " + docCharset + "\n"); } 
add: var focusedWindow = document.commandDispatcher.focusedWindow; if (focusedWindow == window) focusedWindow = _content;  var docCharset = focusedWindow.document.characterSet;  var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"] .getService(Components.interfaces.nsIBookmarksService);  bmks.AddBookmark(url, title, bmks.BOOKMARK_DEFAULT_TYPE, docCharset); debug("BrowserAddBookmark: " + docCharset + "\n"); } 
context:   function BrowserAddBookmark(url,title)  {    var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();    var wnd = document.commandDispatcher.focusedWindow;    if (window == wnd) wnd = window._content;    var docCharset = wnd.document.characterSet;    bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);    if ((title == null) || (title == ""))    {    	title = url;    }    bmks.AddBookmark(url, title, bmks.BOOKMARK_DEFAULT_TYPE, docCharset);    debug("BrowserAddBookmark: " + docCharset + "\n");  }
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/92cdde73d6c5437e6043c71e16e0f4952ccabb2e/navigator.js/buggy/xpfe/browser/resources/content/navigator.js