[Greasemonkey] Adding Bookmarks from GM
Dave Land
land at aol.com
Tue Sep 6 01:22:18 EDT 2005
On Sep 5, 2005, at 11:34 PM, Bill Donnelly wrote:
> I started looking into this and never finished.
> I wanted to have a bookmarklet that started up the bookmark dialog.
> And/or would do an "auto-bookmark", kind of the way IE does.
> Mostly I just wanted a clickable Bm icon that is on my browser
> bm's toolbar that I could easily click without having to do a
> drop-down menu item or 'stop' and press Ctrl-D.
> I'm pretty sure it can be done, maybe without creating an actual
> extension. If you come up with something, please let us know.
I started to reply to this thread yesterday, but decided that my sad
little one-line script wasn't what people were looking for, due to the
requirement to check the existing bookmarks and only create a new one if
it hadn't been marked before.
BUT: the bottom line, as stated before, is that there's no way for
JS to get at existing bookmarks, and no way for JS to quietly stuff
a Bookmark into your list (which is a good thing, because otherwise,
the whole concept of bookmarks would have long ago been ruined by
bookmark spam).
Good news: bringing up the bookmark dialog is a one-liner:
window.sidebar.addPanel( document.title, location.href, '')
A script based on that one-liner is attached.
It pops up the Add Bookmark dialog every time a targeted page (the
greasemonkey mailing list archive, which I used for testing, since I no
longer -- much to my grieving heart -- use PERL) is visited. It doesn't
have *anything* like the smarts in the outstanding (and already
referenced) MonkeyDo script -- it is a butt-simple one-liner that pops
up the bookmark dialog with the title and URL of the page filled in for
*every* targeted page. That means that it is stupid, stupid, stupid.
But at least it does something related to your need.
Peace,
Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoaddbookmark.user.js
Type: text/javascript
Size: 363 bytes
Desc: not available
Url : http://mozdev.org/pipermail/greasemonkey/attachments/20050906/4b8d7c05/autoaddbookmark.user.bin
More information about the Greasemonkey
mailing list