error in bookmark observer, while buidling firefox addon -


okay have created observer bookmark service,
function triggered observer,when bookmark item removedonitemremoved: function(id, folder, index)

arguments in function (id,folder,index)
when try access bookmark url , title usinggetitemtitle(id) , getbookmarkuri(id).spec; nsi illegal value error.
id of bookmark integer (1935 etc)
can't see why bookmark url not returned? clue?

when bookmark item removed id no longer useful. onitemremoved method takes more arguments 3 mentioned though, takes aid, aparentid, aindex, aitemtype, auri, ... can use auri argument url interested in.

the better option use sdk/places/events module though, so:

const { events } = require('sdk/places/events');  events.on('bookmark-item-removed', ({ data }) => {   let url = data.url;   // ... }) 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -