Besttoolbars Development network

Back to Besttoolbars main site

 

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
firefox variable <toolbarname>.custom_xmls is growing.

 
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> Mozilla/Firefox conversion
Author Message
taw



Joined: 18 Jun 2007
Posts: 41
Location: Munich, Germany

PostPosted: Tue Jul 17, 2007 8:48 am    Post subject: firefox variable <toolbarname>.custom_xmls is growing. Reply with quote

In about:config I see the Variable <toolbarname>.costum_xmls.
What is is for?

It's value seems to grow weirdly.

I'm using Toolbarstudio Version 3.5.0.5


Last edited by taw on Thu Oct 11, 2007 11:08 am; edited 1 time in total
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Tue Jul 17, 2007 9:29 am    Post subject: Reply with quote

There is Custom XML feature in Toolbars, you may send us your .cab, we'll check why these values are accumulated, but it won't affect on the whole functionality of toolbar in any case.
Back to top
taw



Joined: 18 Jun 2007
Posts: 41
Location: Munich, Germany

PostPosted: Thu Oct 11, 2007 11:07 am    Post subject: Reply with quote

I found the codesection generating the bug:

Code:

function <toolbarname>_custom_xml( sName, sXMLData )
{
   var tb = document.getElementById('<toolbarname>-toolbar');
   var include=tb.getElementsByTagName("box");
    if (!include || include == '' || include == 'undefined') return;
    for( var i=0; i<include.length; i++ )
   {
      var cmb_tmp = include.item(i);
        if( !cmb_tmp.getAttribute('filename') )
           continue;
        if( cmb_tmp.getAttribute('filename') != '_custom_xml_'+sName )
           continue;
      cmb_tmp.setAttribute( 'xmldata', sXMLData );
      cmb_tmp.setAttribute( 'layout', <toolbarname>_tool.Layout );
        for( var j=0;j<<toolbarname>_customXml.length;j++ )
       {
         if( <toolbarname>_customXml[j].name != "_custom_xml_"+sName )
            continue;
         <toolbarname>_customXml[j].xmldata=sXMLData;
        }
        if (j == <toolbarname>_customXml.length)
         <toolbarname>_customXml.push( new customXml("_custom_xml_"+sName, sXMLData) );
      break;
    }
}



In the inner for-loop, there is no "break"-instruction, so (j == <toolbarname>_customXml.length) is always true. This results in a constantly growing <toolbarname>_customXml array, which is stored in firefox user preferences.
Back to top
taw



Joined: 18 Jun 2007
Posts: 41
Location: Munich, Germany

PostPosted: Mon Oct 15, 2007 12:00 pm    Post subject: Reply with quote

Inserting one "break"-instruction in function <toolbarname>_custom_xml( sName, sXMLData ) would do it:
Code:

        for( var j=0;j<<toolbarname>_customXml.length;j++ )
       {
         if( <toolbarname>_customXml[j].name != "_custom_xml_"+sName )
            continue;
         <toolbarname>_customXml[j].xmldata=sXMLData;
>         break;
        }


But I also suggest to add the following two lines in function <toolbarname>_save_vars() to help people which just upgraded their toolbar. (Firefox surely slows down when updating userprefs more than 10000 times each time a user closes a window)
Code:

    var XMLnames='';
   for( var j=0;j<<toolbarname>_customXml.length;j++ )
    {
>   if (('///'+XMLnames).indexOf('///'+<toolbarname>_customXml[j].name+'///') != -1)
>      continue;
       XMLnames+=<toolbarname>_customXml[j].name+'///';
      <toolbarname>_pref( "<toolbarname>.custom_xmls."+<toolbarname>_customXml[j].name, <toolbarname>_customXml[j].xmldata );
    }


I would be grateful, if you could add these lines in one of your following toolbarstudio versions.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> Mozilla/Firefox conversion All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group

Copyright c Softomate, 2010. All Rights Reserved
Terms of Service | Privacy Policy