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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -