CopyUrlPlus provides the means of extracting the title of a webpage along with the url and selected text for reuse in documentation in HTML pages, or email. Copy URL + is certainly one of my favorite extensions, and this page documents some of my own use and customizations. « Additional Favorite Extensions in big list.
Copy URL + Title | |
Copy URL + Selection | |
Copy URL + Title + Selection | |
Copy URL + <dt>title<dd>selection / url | |
Copy URL + <a href=...>...</a> | |
Copy URL + <a href=... title=selection>...</a> | |
Copy URL + <a href=...>...</a>, selection | |
Convert TEXT to HTML code | |
DIV + <a href=...>...</a>, selection |
! Compatibility Warning! A user modified ver 1.3.2 for use with Fx2 can be installed without turning off compatibility testing. Read more about overriding compatibility testing. But first check for availability of a more recent version of CopyURL Plus.
The CopyURL+ extension for copying and pasting the link title, and url from the line anchor information, along with the current selection, is easily customized to format this information using COPYURL patterns of your choice to paste into other applications. Some suggested customization patterns are included for blogging, HTML, plain text for email, and other uses have been provided.
There are 3 builtin menu items, you will always see the first, but the second and third only appear if you have a selection.
B1: | Title/url | -- available, even if url has no Title |
B2: | Selection/url | -- available if there is a selection |
B3: | Title/selection/url | -- available if there is a selection |
There is no check on user customization as to whether you have made a selection, or are rightclicking on a link so you may get a empty string in your results.
Forward slashes in the label (display) represent new line.
Backward slahses represent special (escape) characters, or the exact character indicated in some cases. Use of \n indicates a new line in the output -- does not effect HTML itself. Use of \" indicates a doublequote, don't know what \1 means but have seen it introduced into the output of htmlified url such as from a Google Search and it does not appear to effect usage.
(code below was copied from user.js and prepared for this HTML document using some Excel VBA coding)
--
While you can read most of this document on half of a 768 x 1024 screen, it would be best to use full width when looking at code due to line wrapping, or intentional newline inflicted for readability. Each of the following lines of code begins with user_pref.
Use of offset requires a CSS style definition for offset. If you look in
the source for firefox.htm you will see the following
three lines. Incidentally the OFFSET was used above and you will notice it
for continuation lines above.
.offset {margin-left:+2em; text-indent:-2em;}
.outdent {margin-left:-0; text-indent:-1.2em;}
.indent {margin-left:+0em; text-indent:+2em;}
——
Additional examples in Copyurl, Links with Style later in this webpage.
An easier way of updating user.js than you've probably seen elsewhere.
\n new line x'10'
\r carriage return x'0A'
\\ backslash x'5C'
\t tab X'09'
\xhh hex characters x'hh'
Don't know how much of this applies but it is one of many such such articles describing similar escape characters:
3.2 Escape Sequences in the GNU Awk User's Guide.
(-) | Copy URL + Title |
(-) | Copy URL + Selection |
(-) | Copy URL + Title + Selection |
(1) | Copy URL + <dt>title<dd>selection / url |
(2) | Copy URL + <a href=...>...</a> |
(3) | Copy URL + <a href=...title=selection>...</a> |
(4) | Copy URL + <a href=...>...</a>, selection |
(5) | Convert TEXT to HTML code |
(6) | DIV Offset + <a href=...>...</a>, selection |
mozdev.org - copyurlplus: customize
http://copyurlplus.mozdev.org/customize.html
"As of version 1.1, Copy URL+ allows you to add your own menu entries. By simply adding a couple of entries to the user.js file, you can create countless custom entries"
http://copyurlplus.mozdev.org/customize.html
mozdev.org - copyurlplus: customize
"As of version 1.1, Copy URL+ allows you to add your own menu entries. By simply adding a couple of entries to the user.js file, you can create countless custom entries"
http://copyurlplus.mozdev.org/customize.html
keyword shortcuts (onsite), examples of keyword shortcuts used in a separate folder, and how to find them if someone sprinkled them throughout the bookmark.html file. in the profile directory.
-- http://www.mvps.org/dmcritchie/firefox/kws.htm
ref: COPYURL Plus, format a link and selection to paste into HTML
ref: -- http://www.mvps.org/dmcritchie/firefox/copyurlplus.htm
(2) Copy URL + Title / Selection -- 60 articles
COPYURL Plus, format a link and selection to paste into HTML
"format this information using COPYURL patterns of your choice"
-- http://www.mvps.org/dmcritchie/firefox/copyurlplus.htm#preparation
mozdev.org - copyurlplus: customize — (5) Selection is internalized with TITLE
Firefox Customizations, (onsite), customizations used, problems encountered, extensions in use (or previously used) as reported in COPYURL Plus, format a link and selection to paste into HTML – (6) Requires a selection AND the cursor on a (Remote) Link.
mozdev.org - copyurlplus: customize, As of version 1.1, Copy URL+ allows you to add your own menu entries. By simply adding a couple of entries to the user.js file, you can create countless custom entries
— (7) Selection is externalized, appears after the link and a comma
In Outlook Express you can send out as text only or as HTML formatted text.
The easiest is as Plain Text, simply make a selection and paste from one of the Plain Text choices.
Copy material into Notepad and save as HTML (file:\c:\temp\temp.htm)
Firefox update squashes security bugs | Tech News on ZDNet
|
The Copyurl material in user.js might be modified as follows the above purpose (60 links)
Because of the extensive number of links that might be stacked under one another a newline, \n, has been inserted at the beginning and at the end of the definition. user_pref("copyurlplus.menus.1.copy", "\n%TITLE%\n \"%SEL%\"\n -- %URL%\n"); user_pref("copyurlplus.menus.1.label", "Copy URL + Title / Selection -- 60 articles"); |
Copy material into Notepad and save as HTML (file:\c:\temp\temp.htm)
<P> <a href="http://news.zdnet.com/2100-1009_22-5785672.html?tag=nl.e589">Firefox update squashes security bugs | Tech News on ZDNet</a>, Firefox 1.0.5, released Tuesday, patches a dozen bugs in the open-source Web browser, some of them "high risk," said Chris Hofmann, director of engineering at Mozilla. |
Open as HTML and copy what you want, and then paste into Outlook Express formatted as HTML
Firefox update squashes security bugs | Tech News on ZDNet, Firefox 1.0.5, released Tuesday, patches a dozen bugs in the open-source Web browser, some of them "high risk," said Chris Hofmann, director of engineering at Mozilla. |
STYLE added to the HTML document, to be used by the generated coding.
<style type="text/css"> .offset {margin-left:+2em; text-indent:-2em;} .item {font-size: smaller; font-weight: bold; font-family: Arial; color: #000080; vlink: #000000; link: #000000; alink: #000000} .related {color: #800000;} .see {color: #800000;} </style> |
Copyurl Additions for use with Style coding shown above.
user_pref("copyurlplus.menus.8.copy", "<div class=\"item\"><a href=\"%URL_HTMLIFIED%\">%TITLE_HTMLIFIED%</a></div>\n"); user_pref("copyurlplus.menus.8.label", "ITEM*** -- <a href=...>...</a>"); user_pref("copyurlplus.menus.9.copy", "<div class=\"item\"><span class=\"related\"> Related: </span> <a href=\"%URL_HTMLIFIED%\">%TITLE_HTMLIFIED%</a></div>\n"); user_pref("copyurlplus.menus.9.label", "**Related -- <a href=...>...</a>"); user_pref("copyurlplus.menus.10.copy", "<div class=\"item\"><span class=\"see\"> See also: </span> <a href=\"%URL_HTMLIFIED%\">%TITLE_HTMLIFIED%</a></div>\n"); user_pref("copyurlplus.menus.10.label", "**See also-- <a href=...>...</a>"); |
Generated Examples as Displayed. Use selection and display selection source on the context menu to see the actual HTML coding. http://home.att.net/~news_items/Items_in_the_news.html
Caterpillars Invade New Mexico Forests had to change title subject
|
Generated HTML code —
(code below was prepared using some Excel VBA coding)
word-wrap:break-word; — used to force mozilla to wrap at width of table for preformatted text (<code>, <pre>, <tt>>) <div class="item"><a href="http://www.enn.com/today.html?id=8222">ENN: Environmental News Network [[Today's News Full Story ]]</a></div> <div class="item"><a href="http://www.nj.com/news/gloucester/index.ssf?/base/news-0/1121156125123570.xml &%5C1coll=8"> DuPont agrees to preserve 1,875 acres</a></div> <div class="item"><span class="see"> See also: </span> <a href="http://www.ens-newswire.com/ens/jul2005/2005-07-11-09.asp#anchor1">Environment News Service ENS Latest Environmental Information Education Current Issues RSS</a></div> <div class="item"><a href="http://www.latimes.com/news/printedition/asection/la-na-toxics13jul13,1,6092909.story? coll=la-news-a_section&%5C1ctrack=1&%5C1cset=true">EPA Is Faulted as Failing to Shield Public From Toxins</a></div> <div class="item"><span class="related"> Related: </span> <a href="http://www.ens-newswire.com/ens/jul2005/2005-07-13-09.asp#anchor5">Environment News Service ENS Latest Environmental Information Education Current Issues RSS</a></div> <div class="item"><a href="http://www.eurekalert.org/pub_releases/2005-07/ou-spd071105.php">Study: Predatory dinosaurs had bird-like pulmonary system</a></div> <div class="item"><span class="see"> See also: </span> <a href="http://www.nature.com/news/2005/050711/full/050711-8.html">news @ nature.com - Dinosaurs breathed like birds - Fossil bones show air pockets for high-energy lifestyle.</a></div> Note that one item had to be changed, for this type of data it might be better to use a selection |
Locating your profile was greatly simplified in Firefox 3.5, as all you need to do now is
Help [Alt+H] → Troubleshooting Information... → "Open Containing Folder"
The rest of this topic describes a simpler form of the horrible round about way you had to use to find your profile. Don't forget about backing up all of your user data.
Your code to customize Copyurl must be placed into user.js in your Firefox profile. I would not recommend installing ChromeEdit nor the method for finding your profile mentioned in these documents but you should read and be familiar with Firefox Help: Editing Configuration Files and Firefox Help: Tips & Tricks
Decode HTML |
slnk = MyDataObj.GetText
slnk = Replace(slnk, "&", "&")
slnk = Replace(slnk, Chr(160), " ")
slnk = Replace(slnk, "<", "<")
slnk = Replace(slnk, ">", ">")
slnk = Replace(slnk, Chr(34), """)
slnk = Replace(slnk, "\n", "<span style=""color: red; font-weight: bold;"">\n</span>")
slnk = Replace(slnk, vbCrLf, "<+$br$+>")
slnk = Replace(slnk, vbCr, "<+$br$+>")
slnk = Replace(slnk, vbLf, "<+$br$+>")
slnk = Replace(slnk, "<+$br$+>", vbCrLf & "<br>")
If redoing this page in the future you can use CopyURL Plus itself to convert text to HTML.
user_pref("copyurlplus.menus.7.copy", "%SEL_HTMLIFIED%");
user_pref("copyurlplus.menus.7.label", "Convert TEXT to HTML code");
URL (exists) URL of the current page TITLE (exists) TITLE of the current page RLINK (exists) the url (href) supplied in the link RTEXT the text displayed within the link (available in CoLT extension) RTITLE the title= internal to the anchor RLINK XTITLE if possible to go out to the link and get it's actual title XSIZE size of the url download if provided by server (and if available in Firefox extension) since it does not include images or other embedded items it is only a guideline. CLINK copy the whole enchilada as is, same as using Firefox's View Selected Source and pick out the actual link from and including ... which is probably more useful for copying from your own web pages since you will know exactly what is there.I don't know how much data can be obtained from a server without actually downloading a file, and something like getting a filesize is available in Internet Explorer bookmarklets but not available in Firefox bookmarklets.
also partial to someone else's request, Robert Hughes on 2005-10-14 (dead link), that would do what is currently done for the cursor not on a link for all of the open tabs, and how would you invoke that without defining whole new sets. (see Copy All Urls uses h4 and needs a little tweak to put title first, but it's a fairly decent solution)
I've not been able to find out how or when doubling occurs as it can go for quite some time before the problem appears. I was playing with DOM inspector, and with sidebar pages, and also there was a Firefox failure sometime in morning (2006-03-26) and the problem was seen and corrected in the afternoon.
Without reinstalling CopyURLplus the stripped down directions are no longer working not even with a reboot.
Please send your comments concerning this web page to: David McRitchie send email comments
Copyright © 2004 - 2006, F. David McRitchie, All Rights Reserved