MozillaZine

FF - Saving pages - how to insert <!-- saved from url=...

Discussion of features in Mozilla Firefox
Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted October 5th, 2006, 4:47 pm

Is it possible to automatically insert a '<!-- saved from url=...'-like comment inside the saved page (IE does that)? I know the Scrapbook extension, but I have to be able to open my saved pages from the USB stick, often with alternate browsers on other PCs, so I would appreciate the file structure/names preserved and the URL inserted inside the saved .html.
Chupo

Unarmed
 
Posts: 4941
Joined: July 31st, 2003, 1:26 pm

Post Posted October 5th, 2006, 7:16 pm

No, that’s <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=125729" title="Bug 125729 - When saving page, add source URL address as comment ('saved from ...') [Save As, Save Page As]">bug 125729</a>.

Grist

User avatar
 
Posts: 836
Joined: January 27th, 2006, 9:20 pm

Post Posted October 5th, 2006, 9:07 pm

This extension inserts a comment with the current page address into the DOM:

The comment should be present in any page saved as "Web Page - Complete".

Compiled from a simple Greasemonkey script:
Code: Select all
// ==UserScript==
// @name           Saved from URL Comment
// @description    Inserts an HTML comment with the current document address.
// @include        *
// ==/UserScript==

var urlComment = document.createComment(' Saved from URL = ' + document.location.href + ' ');

document.insertBefore(urlComment, document.firstChild);
Last edited by Grist on October 21st, 2006, 9:57 pm, edited 1 time in total.

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted October 6th, 2006, 5:46 am

Thank you very much (both of you)! I am going to read about the bug in detalis. Meanwhile, the SavedFromUrl extension works fine :-) FF is going to become my defoult browser!

Cheers!
Chupo

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted October 6th, 2006, 5:50 am

Me wrote:defoult browser


Default, I meant :-)
Chupo

Grist

User avatar
 
Posts: 836
Joined: January 27th, 2006, 9:20 pm

Post Posted October 6th, 2006, 11:55 am

Works with 1.5 - 2.0.
Update:
<a href="http://dourob8.100webspace.net/extensions/SavedFromUrl1.4.xpi">http://dourob8.100webspace.net/extensions/SavedFromUrl1.4.xpi</a>

I did away with the compiled user script and built the extension from scratch. It only inserts the comment when "Save Page As" is used. Also added the date and time to the comment:
Code: Select all
Saved from:
 http://forums.mozillazine.org/viewtopic.php?t=471634

 on:
 Fri Oct 06 2006 14:48:28 GMT-0400 (Eastern Standard Time)

  • 1.4 - No longer removes pre-existing comments that exist at the top of the document.
  • 1.3 - Works with frame pages.

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted February 23rd, 2010, 6:19 pm

Hi again :-)

it's been a few years!! since I started this thread and you posted me your SavedFromUrl extension. I still have two versions in a folder:

SavedFromUrl.xpi (6. Oct 2006, 1:30:30) and
SavedFromUrl1.2.xpi (7. Oct 2006, 12:01:46)

I am not sure why I don't have v1.4 and how did I get v1.2 (maybe you posted 1.2 the next day after the first version). In fact I didn't remember about this thread anymore and I've found it again searching for the extension update!!

As you can guess, I have only now updated to FF3.6 so I can't use SavedFromUrl anymore :-( I was looking thru FF's official addons but did't find the extension so I had to install FF2.0.0.20 portable to be able to install your extension one more time to see the about screen and find out your name :-) Only then I've, after a long time, found this very thread again and seen my nick. It was a double surprise - first I didn't remember about the thread and now I can't believe how much time has passed since then.

Did you maybe make an update that works with FF3.6 in the meanwhile?

Regards,
Chupo

dickvl

User avatar
 
Posts: 53045
Joined: July 18th, 2005, 3:25 am

Post Posted February 24th, 2010, 1:42 pm

Here is a bumped version of SavedFromUrl1.4.xpi (copy & paste full code in the location bar and save as SavedFromUrl1.4.xpi)
Code: Select all
data:application/octet-stream;base64,
UEsDBAoAAAAAAJeKRjUAAAAAAAAAAAAAAAAHAAAAY2hyb21lL1BLAwQUAAAACACxAUc1fl2wa0cA
AAB7AAAADwAAAGNocm9tZS5tYW5pZmVzdEvOzytJzSvhLE4sS01JK8rPLS3KUUjOADJS9aFy+lz5
ZalFOYmVnBBxK339pKL88uLUI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eAsAAQTpAwAABGQAAAB9kM1u2zAQhM/1UxB0TwUoUj+J
LcFyUCRNGyD1IU17p8hVTEAkBZKK3BR991K2azc59MADZ2d3Z7/V1U536BmcV9bUOE0YvlrPVg83
t1V8KBaNr0DXeBtCX1E6jmOi7YvqOp5Y90QzxgoKmjjZzvHs3bFhc31q2FoNiYHgBe8hEVbTzfUb
d1z0av6Y70enZVlSltEsm/zE/zSB74jxc7yezRBC+5A34IVTfYjp0fTnjR1CjQdnqmPMShkfeNcR
zY1qwYe4GHSlZI1/NZCyrM0kadpiQYpSNmQphSA8E0KmYinzxeXvg99wDTX+xp9BoltnNfr+cH+o
/AOvOCjCAQ/W1fizU3/3yXPQGt8ZDy54xA368vj1HkUsGkxAowpbFLaAxODcJEgrhn2FS+nA+yTe
Pp0eBwbuniB87PtOCX66P5rs4ESMGplV8/cb9/hJ5ZhObSv6hthe/A/FVyPO1EAsWc7aBREZ46S4
LFpSNgxImvOcl1Au8mVxpKaV+XHGc3EU+e4klskHjGK6Q7b41n8AUEsBAhQACgAAAAAAl4pGNQAA
AAAAAAAAAAAAAAcAAAAAAAAAAAAQIAAAAAAAAGNocm9tZS9QSwECFAAUAAAACACxAUc1fl2wa0cA
AAB7AAAADwAAAAAAAAAAACAgAAAlAAAAY2hyb21lLm1hbmlmZXN0UEsBAhQACgAAAAAAyIJINQAA
AAAAAAAAAAAAAA8AAAAAAAAAAAAQIAAAmQAAAGNocm9tZS9jb250ZW50L1BLAQIUABQAAAAIAA+n
SjWFM/B3cwIAAFQFAAAaAAAAAAAAAAAAICAAAMYAAABjaHJvbWUvY29udGVudC9vdmVybGF5Lnh1
bFBLAQIeAxQAAAAIAMY54T4x79vAkAEAAJICAAALABgAAAAAAAEAAADtgXEDAABpbnN0YWxsLnJk
ZlVUBQADo1cNTnV4CwABBOkDAAAEZAAAAFBLBQYAAAAABQAFAEgBAABGBQAAAAA=
Last edited by dickvl on June 30th, 2011, 10:16 pm, edited 2 times in total.

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted February 24th, 2010, 5:17 pm

dickvl wrote:Here is a bumped version of SavedFromUrl1.4.xpi with a maxVersion of 3.* (copy & paste in the location and save as SavedFromUrl1.4.xpi)

What do you mean by 'paste in the location'? I've tried to decode the attachment with online base64 decoder but there was an error: 'Invalid character in a Base-64 string.'.
Chupo

dickvl

User avatar
 
Posts: 53045
Joined: July 18th, 2005, 3:25 am

Post Posted February 24th, 2010, 8:35 pm

If you use an online decoder then you need to omit the leading data part. Not all online decoders may like the line breaks in the code.
You can copy and paste the full code, including the data descriptor, to the location (address) bar and press the Enter key, just like you open a website and Firefox should offer to save the file.

See http://en.wikipedia.org/wiki/Data:_URI_scheme

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted February 25th, 2010, 6:14 am

Thank you very much!! Works like a charm :-)

I didn't know that MIME encoded content could be pasted into the address bar and didn't realize that 'location' refers to 'location bar'. The name after saving was B2k+NTe1.part and the next time 2izQbFXS.part so I assume FF always chooses the random name when saving the URI scheme data.

Is this extension open source? It would be nice to be able to edit the insertion scheme. Why this extension doesn't have a web page so it could be found thru add-ons search?

ps
Do you maybe know if there's an extension to search bookmarks by the description (FF3.6 comaptible)? I was using Enhanced Bookmark Search extension in FF2.x.x.x but now I can't find a way to search bookmark descriptions anymore :-/
Chupo

Platon_
 
Posts: 3912
Joined: July 30th, 2009, 2:42 am

Post Posted February 25th, 2010, 6:29 am

Removed #-o I was suggesting the same obsolete extension.
Last edited by Platon_ on February 25th, 2010, 9:30 am, edited 2 times in total.

dickvl

User avatar
 
Posts: 53045
Joined: July 18th, 2005, 3:25 am

Post Posted February 25th, 2010, 7:40 am

You can easily open the extensions .xpi file and make the edits in SavedFromUrl1.4.xpi/chrome/content/overlay.xul
XPI files are regular ZIP archives.

Code: Select all
var comment = d.createComment(' Saved from:\n ' + d.location.href + '\n\n on:\n ' + Date() + '\n');

Chupo

User avatar
 
Posts: 7
Joined: October 5th, 2006, 4:30 pm
Location: Hrvatska (Croatia)

Post Posted March 9th, 2010, 10:50 am

Thanx! Now I remember I had even examined 'Save From URL' back in 2006!! but I forgot the .xpi <=> .zip :-/
Chupo

ake79
 
Posts: 1344
Joined: February 17th, 2007, 6:05 am

Post Posted December 6th, 2010, 2:55 am

I made version that supports Save File to at vic123's request.

It's somewhat modified version but still does the same thing. Basically I just moved the comment adding a bit later so Save File to catches it. Should work.

Like dickvl's version before, copy & paste into the location bar, save as .xpi file and drag & drop to ff window to install.

Saved From URL 1.4.20101206:
Code: Select all
data:application/zip;base64,
UEsDBBQAAAAIAG6xhT22y2+E6gEAAJwDAAALABwAaW5zdGFsbC5yZGZVVAkAA+/x+0zv8ftMdXgL
AAEE6AMAAAToAwAAdZNNbtswEIX3PgWrAF0UoP5rS64kI0Dgtmi6SZPuKXJkExBJgaQiN0Fv05v0
YrVpy7IRdMPFm+8NZ/TEYrUTLXoGbbiSpRf5oYdAUsW43JTe0+MaZx5aVbNZ8XC3RntWmtLbWtst
g2AYBn9IfKU3QZTneRDGQRxjzRpsfklLdliaG+/oWYK4sgn1wtuWOG8chmkA4mC88aoZQsUdGKp5
Z/cjIVKr3pZer+XyZFpyaSxpWyyI5A0Y60wIuaMAseSseq0hCuMmZrhu0gVOc1bjjFGKSUwpi2jG
ksX8dxEc6bNTEgHVD/IMDK21Eujp4d4xTj9Tp69VRX7qx2EURnE4d9hYOJNsWqT6Kg1oaxCR6Mvj
93tElRAgLRq43SK7BUR7rQ8CU7R3FcKYBmN81/uy1bk/1UCs0tVnzY112KhMiJJW87o/iLfWAvoG
out4+/fPkb8onz1bJaAjG9ivX51Ca5TuhRlze+ESXHbPHAarOk79btutmjJ7T0T3yZbpIponqbvh
stlFTu8wRmuuoVE7hPF0tyV6A/a261pOybTt9V8xalPeQLMwCZsFpnFIcDpPG5zXIeAoIQnJIV8k
WXqd9+gWXP48B/rRIRfSNUp2o574c//DEZ7EcdLg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AAAD7AAAAGAAYAAAA
AAABAAAApIEAAwAAY29udGVudC9zYXZlZGZyb211cmwueHVsVVQFAAMh1PtMdXgLAAEE6AMAAATo
AwAAUEsBAh4DFAAAAAgAebeFPbnYeCgAAwAAgAgAABcAGAAAAAAAAQAAAKSBDwQAAGNvbnRlbnQv
c2F2ZWRmcm9tdXJsLmpzVVQFAANG/ftMdXgLAAEE6AMAAAToAwAAUEsFBgAAAAAFAAUArwEAAGAH
AAAAAA==
My extensions: Save File to | ThumbsDown

Return to Firefox Features


Who is online

Users browsing this forum: No registered users and 1 guest