Help needed: sdk/places/bookmarks search function seems not to be background / worker?

12 views
Skip to first unread message

Ruben Goethals

unread,
Jun 17, 2015, 10:27:52 AM6/17/15
to mozilla-la...@googlegroups.com
Hello,

Can someone confirm that the search function to search for bookmarks is interrupting the UI and thus when having a lot of bookmarks is quite user-unfriendly?
See the relevant part of my addon's code below.  It makes firefox unresponsive for sometimes 8 seconds! (I have 3000+ bookmarks and 500+ tags).

And if so, should I make my ow worker for it or will it remain the same as I have read in the doc that workers use the same process? But maybe a seperate "process" is not required to be able not to interrupt the UI?

Great thanks if anyone has some info about this.


const { search }        = require("sdk/places/bookmarks");
/*
 * Other code of course, below the method of my class
 */

   
    getBms
: function() {                    console.log("getBms start",this.tags);
        let
BxB = this;
       
//Bookmarks search for tags and sort by
        search
(      [{ tags: this.tags }],  sort[this.order]        )
           
.on("end", function(results) {
               
                results
.forEach(function(bm){        //console.log("Search ended for " + BxB.id)
                   
BxB.addmenuitem(bm.id, bm.title, bm.url, getFavicon(bm.url));    
               
});
                view
.setIcon(BxB.id, window, {
                     
"16": "./tag16.png",
                     
"32": "./tag32.png",
                     
"48": "./tag48.png"
                   
});                                    console.log("getBms SEARCH end");
           
});
   
},


Reply all
Reply to author
Forward
0 new messages