アドレスバーの★押したときに誰がハンドルしてるか
~/mozilla/browser/base/content/browser-places.js
bookmarkPage: function PCH_bookmarkPage(aBrowser, aParent, aShowEditUI) { var uri = aBrowser.currentURI; var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri); if (itemId == -1) { // Copied over from addBookmarkForBrowser: // Bug 52536: We obtain the URL and title from the nsIWebNavigation // associated with a <browser/> rather than from a DOMWindow. // This is because when a full page plugin is loaded, there is // no DOMWindow (?) but information about the loaded document // may still be obtained from the webNavigation. var webNav = aBrowser.webNavigation; var url = webNav.currentURI; var title; var description; var charset; try { title = webNav.document.title || url.spec; description = PlacesUIUtils.getDescriptionFromDocument(webNav.document); charset = webNav.document.characterSet; }
description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
っていうのはなんだ。
meta descriptionなのか。それで入ってたり入ってなかったりするわけね。
~/mozilla/browser/components/places/content/utils.js
/** * Get the description associated with a document, as specified in a <META> * element. * @param doc * A DOM Document to get a description for * @returns A description string if a META element was discovered with a * "description" or "httpequiv" attribute, empty string otherwise. */ getDescriptionFromDocument: function PU_getDescriptionFromDocument(doc) { var metaElements = doc.getElementsByTagName("META"); for (var i = 0; i < metaElements.length; ++i) { if (metaElements[i].name.toLowerCase() == "description" || metaElements[i].httpEquiv.toLowerCase() == "description") { return metaElements[i].content; } } return ""; },
これ後から変更するのは無理そう。たどってみたら上のほうでイベントリスナとして関数が登録されてる。