PK .6chrome/PK 06suuchrome.manifestcontent linkpurl chrome/content/ overlay chrome://browser/content/browser.xul chrome://linkpurl/content/linkpurl.xulPK w06chrome/content/PK h06ƀ chrome/content/linkpurl.js// function getLinkRel (webNav, rel) { // if ( node.nodeName == 'LINK' && node.attributes.getNamedItem('rel').value == rel ) { // ORIGINAL CODE // DCS // created: 2005-02-07 // creator: Devon Smith // rights: Mozilla Public License 1.1, Copyright (c) 2005 OCLC Online Computer Library Center, Inc. function getLinkPurl (webNav) { // To minimize abuse potential, only use the FIRST head element var headChildren; var url = null; try { headChildren = webNav.document.getElementsByTagName('head').item(0).childNodes; } catch (e) { alert("error: " + e); return null; } for (var i = 0; i < headChildren.length; i++ ) { var node = headChildren.item(i); try { if ( node.nodeName == 'LINK' && node.attributes.getNamedItem('rel').value == 'purl' ) { // Only use the first PURL; others will be ignored. url = node.attributes.getNamedItem('href').value; break; } } catch (e) { alert("error: " + e); continue; } } return url; } // END ORIGINAL CODE // DCS /* * The following functions are from content/browser/browser.js * I've made simple modifications to each to call the getLinkPurl() */ function addBookmarkForTabBrowser(aTabBrowser, aBookmarkAllTabs, aSelect) { var tabsInfo = []; var currentTabInfo = { name: "", url: "", charset: null }; const activeBrowser = aTabBrowser.selectedBrowser; const browsers = aTabBrowser.browsers; for (var i = 0; i < browsers.length; ++i) { var webNav = browsers[i].webNavigation; var url = getLinkPurl(webNav) || webNav.currentURI.spec; var name = ""; var charSet, description; try { var doc = webNav.document; name = doc.title || url; charSet = doc.characterSet; description = BookmarksUtils.getDescriptionFromDocument(doc); } catch (e) { name = url; } tabsInfo[i] = { name: name, url: url, charset: charSet, description: description }; if (browsers[i] == activeBrowser) currentTabInfo = tabsInfo[i]; } var dialogArgs = currentTabInfo; if (aBookmarkAllTabs) { dialogArgs = { name: gNavigatorBundle.getString("bookmarkAllTabsDefault") }; dialogArgs.bBookmarkAllTabs = true; } dialogArgs.objGroup = tabsInfo; openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", BROWSER_ADD_BM_FEATURES, dialogArgs); } function addBookmarkForBrowser(aDocShell, aIsWebPanel) { // Bug 52536: We obtain the URL and title from the nsIWebNavigation // associated with a 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 url = getLinkPurl(aDocShell) || aDocShell.currentURI.spec; var title, charSet = null; var description; try { title = aDocShell.document.title || url; charSet = aDocShell.document.characterSet; description = BookmarksUtils.getDescriptionFromDocument(aDocShell.document); } catch (e) { title = url; } BookmarksUtils.addBookmark(url, title, charSet, aIsWebPanel, description); } PK *06[Fchrome/content/linkpurl.xul PK 06F9! install.rdf linkpurl@purl.org Persistent URL Bookmarker 0.2 Bookmark a page's persistent identifier if specified in link@href where link@rel="purl". 2 Devon Smith Michael J. Giarlo http://staff.oclc.org/~smithde/linkpurl/ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 2 2.0.0.* PK uG2 license.txt The contents of this package are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this package except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Initial Developer of the Original Code is Devon Smith and other contributors. Portions created by the Initial Developer are Copyright (c) 2005 OCLC Online Computer Library Center, Inc. All rights reserved. - PK .6chrome/PK 06suu %chrome.manifestPK w06chrome/content/PK h06ƀ  chrome/content/linkpurl.jsPK *06[F chrome/content/linkpurl.xulPK 06F9! install.rdfPK uG2 license.txtPK