[Project_owners] Bookmarks in FF3
InBasic
inb.cor at gmail.com
Fri Jun 13 12:50:57 PDT 2008
Hi joe
I had same problem while ago; here is a solution in my code:
************** XUL Part
*<popup id="placesContext">*
<menuitem id="placesContext_PhOpenSecure"
class="menuitem-iconic menu-iconic PH-Cn-curTab"
*oncommand="bookMarksContext(1)"*
label="&InBasic.Ph.Main.Context.lbl1;"
insertbefore="placesContext_openSeparator"
selectiontype="single"
selection="bookmark"
forcehideselection="livemarkChild|livemark/feedURI|PlacesOrganizer/OrganizerQuery"
/>
************ JS Part
function bookMarksContext(index){
* var bmsvc = Components.classes['@
mozilla.org/browser/nav-bookmarks-service;1']
.getService(Components.interfaces.nsINavBookmarksService);
var
nodeItemId=PlacesUtils.getConcreteItemId(document.popupNode.node);
var nodeURI=bmsvc.getBookmarkURI(nodeItemId).spec; *
if(index==1)
OpenSecure(nodeURI);
else
OpenSecureNewTab(nodeURI);
}
----------
P.S: All necessarily parts are highlighted
P.S: you must use *getBookmarkURI *to get URI of bookmarks node
ref: http://developer.mozilla.org/en/docs/nsINavBookmarksService
enjoy ;)
InBasic
On Fri, Jun 13, 2008 at 13:49, Onno Ekker <o.e.ekker at gmail.com> wrote:
>
>
> On Fri, Jun 13, 2008 at 12:13 PM, joe ertaba <belaviyo at gmail.com> wrote:
>
>> alert(PlacesUtils.nodeIsBookmark(document.popupNode.node));
>>
>> answer is *true*
>>
>> so document.popupNode.node is a bookmakrs uri
>>
>> alert( document.popupNode.node.spec );
>>
>> undefined !
>>
>> I don't know why a URI doesn't have spac ; any idea ?
>
>
> I have no idea, but I'd use DOM Inspector to look up the node, find its
> type and see what childs and attributes it has. Besides looking at the docs,
> that is...
>
> Onno
>
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mozdev.org/pipermail/project_owners/attachments/20080613/0559b864/attachment.html
More information about the Project_owners
mailing list