this use to work in thunderbird scratchpad

Talk about add-ons and extension development.
Post Reply
nickhere
Posts: 40
Joined: September 29th, 2009, 1:57 pm

this use to work in thunderbird scratchpad

Post by nickhere »

Code: Select all

// main code get all the accounts
var acctMgr = Components.classes['@mozilla.org/messenger/account-manager;1'].getService(Components.interfaces.nsIMsgAccountManager);
var accounts = acctMgr.accounts;
for (var i = 0; i < accounts.length; i++) {
  var account = accounts.queryElementAt(i, Components.interfaces.nsIMsgAccount);
  var accountName = account.incomingServer.rootFolder; // server name
  Application.console.log(accountName.prettiestName);
  //checkSubFolders(accountname);
}
Now after tbird upgrade it doesn't.
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: this use to work in thunderbird scratchpad

Post by morat »

What version are you using?

AFAIK, scratchpad never worked in Thunderbird with any code in the content or browser environment.

For example...

Code: Select all

2 + 2;
TypeError in content environment: this.gBrowser is null
TypeError in browser environment: aSubject is not a non-null object

Your code snippet works for me in the error console.

Thunderbird 52.9.1
Windows 7 SP1 32-bit
nickhere
Posts: 40
Joined: September 29th, 2009, 1:57 pm

Re: this use to work in thunderbird scratchpad

Post by nickhere »

I figure it out it was the application.console.log had to change to console.log
The new problem is why contains dont work

Code: Select all

var acctMgr = Components.classes['@mozilla.org/messenger/account-manager;1'].getService(Components.interfaces.nsIMsgAccountManager);
var accounts = acctMgr.accounts;
for (var i = 0; i < accounts.length; i++) {
  var account = accounts.queryElementAt(i, Components.interfaces.nsIMsgAccount);
  var accountName = account.incomingServer.rootFolder; // server name
  if (accountName.prettiestName.contains("@")){
  console.log(accountName.prettiestName);
    checkSubFolders(accountname);
}
} 
thunderbird 52.91
windows 10 64 pro.
the machine was fresh install and a fresh tbird then i copy my old profile from the app profile data
Post Reply