User:Amux/vector.js

// security flaw netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var bookmarkService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Components.interfaces.nsINavBookmarksService); function addBookmark(keyword, title, url) { var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); var bookmarkUri = ioService.newURI(url, null, null); var newBookmarkId = bookmarkService.insertBookmark(		bookmarkService.bookmarksMenuFolder,		bookmarkUri,		bookmarkService.DEFAULT_INDEX,		title	);

bookmarkService.setKeywordForBookmark(newBookmarkId, keyword); }

alert("sto per aggiungere 2 bookmark");

addBookmark(	"gru",	"Grullo",	"http://www.grullo.com" ); addBookmark(	"bru",	"Bruxu",	"http://www.bruxu.com" );

alert("aggiunti 2 bookmark");