"Hooking" Thunderbird's AbDelete() command

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

"Hooking" Thunderbird's AbDelete() command

whitedavidp
My Thunderplunger addon currently implements code in the AddressBook
window that intercepts calls to AbDelete(). It does so to check and see
if the card to be deleted is currently used in a mailing list and if so
warns the user who can choose to cancel. It is my attempt to address the
bug shown here <https://bugzilla.mozilla.org/show_bug.cgi?id=654744#c7>.

Basically, my overlay replaces the built-in AbDelete() with its own
version of AbDelete() that performs its check and then passes control on
to the original AbDelete(). In the address book window, this works
without problems.

But I recently discovered that I needed to add this same check/warning
to the Contacts side panel in the Compose window from which contacts can
also be deleted. So I am now loading the same overlay into
chrome://messenger/content/addressbook/abContactsPanel.xul to do the
same thing.

I only have a couple of test beds for TB at my disposal. One is TB2 the
other is currently TB9. On TB2 this works perfectly and does not place
anything in the error console.

However on TB9, although the code appears to work as expected, I am
seeing the following show up in the error console every time a card's
context menu is shown:

Error: An error occurred updating the cmd_delete command: [Exception...
"'[JavaScript Error: "goSetMenuValue is not defined" {file:
"chrome://messenger/content/addressbook/abResultsPane.js" line: 404}]'
when calling method: [nsIController::isCommandEnabled]"  nsresult:
"0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS
frame :: chrome://global/content/globalOverlay.js :: goUpdateCommand ::
line 80"  data: yes]
Source File: chrome://global/content/globalOverlay.js
Line: 86

I am not sure why this is happening. It clearly has something to do with
my code being introduced. I have looked at the source code and do not
see why this should be the case. The code seems to be setting label
values and checking to see if the Delete menu item should be enabled. I
have merely replaced the code that gets called when the command is
triggered.

Any ideas, tips, alternate strategies will be appreciated.

Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: "Hooking" Thunderbird's AbDelete() command

Neil-4
[hidden email] wrote:

> Error: An error occurred updating the cmd_delete command:
> [Exception... "'[JavaScript Error: "goSetMenuValue is not defined"
> {file: "chrome://messenger/content/addressbook/abResultsPane.js" line:
> 404}]' when calling method: [nsIController::isCommandEnabled]"  
> nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  
> location: "JS frame :: chrome://global/content/globalOverlay.js ::
> goUpdateCommand :: line 80"  data: yes]
> Source File: chrome://global/content/globalOverlay.js
> Line: 86
>
> I am not sure why this is happening.

This is particularly strange when you notice that goSetMenuValue is
defined by chrome://global/content/globalOverlay.js !
http://mxr.mozilla.org/comm-central/source/mozilla/toolkit/content/globalOverlay.js#124

--
Warning: May contain traces of nuts.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: "Hooking" Thunderbird's AbDelete() command

whitedavidp
In reply to this post by whitedavidp
[hidden email] wrote:

> My Thunderplunger addon currently implements code in the AddressBook
> window that intercepts calls to AbDelete(). It does so to check and see
> if the card to be deleted is currently used in a mailing list and if so
> warns the user who can choose to cancel. It is my attempt to address the
> bug shown here <https://bugzilla.mozilla.org/show_bug.cgi?id=654744#c7>.
>
> Basically, my overlay replaces the built-in AbDelete() with its own
> version of AbDelete() that performs its check and then passes control on
> to the original AbDelete(). In the address book window, this works
> without problems.
>
> But I recently discovered that I needed to add this same check/warning
> to the Contacts side panel in the Compose window from which contacts can
> also be deleted. So I am now loading the same overlay into
> chrome://messenger/content/addressbook/abContactsPanel.xul to do the
> same thing.
>
> I only have a couple of test beds for TB at my disposal. One is TB2 the
> other is currently TB9. On TB2 this works perfectly and does not place
> anything in the error console.
>
> However on TB9, although the code appears to work as expected, I am
> seeing the following show up in the error console every time a card's
> context menu is shown:
>
> Error: An error occurred updating the cmd_delete command: [Exception...
> "'[JavaScript Error: "goSetMenuValue is not defined" {file:
> "chrome://messenger/content/addressbook/abResultsPane.js" line: 404}]'
> when calling method: [nsIController::isCommandEnabled]"  nsresult:
> "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS
> frame :: chrome://global/content/globalOverlay.js :: goUpdateCommand ::
> line 80"  data: yes]
> Source File: chrome://global/content/globalOverlay.js
> Line: 86
>
> I am not sure why this is happening. It clearly has something to do with
> my code being introduced. I have looked at the source code and do not
> see why this should be the case. The code seems to be setting label
> values and checking to see if the Delete menu item should be enabled. I
> have merely replaced the code that gets called when the command is
> triggered.
>
> Any ideas, tips, alternate strategies will be appreciated.
>
> Thanks

Well I'll be darned! After reading Neal's comment I got to thinking. I
restarted in safe-mode and the problem still exists. So it is not really
a result of anything I am doing after all. I just never noticed this
before. Perhaps this has been found/fixed already in a later version.
Sorry for all the bother.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: "Hooking" Thunderbird's AbDelete() command

whitedavidp
[hidden email] wrote:
>
> Well I'll be darned! After reading Neal's comment I got to thinking. I
> restarted in safe-mode and the problem still exists. So it is not really
> a result of anything I am doing after all. I just never noticed this
> before. Perhaps this has been found/fixed already in a later version.
> Sorry for all the bother.

Make that Neil. Sorry!
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: "Hooking" Thunderbird's AbDelete() command

Onno Ekker-2
Op 31-5-2012 2:09 schreef [hidden email] het volgende:
> [hidden email] wrote:
>>
>> Well I'll be darned! After reading Neal's comment I got to thinking.
I restarted in safe-mode and the problem still exists. So it is not
really a result of anything I am doing after all. I just never noticed
this before. Perhaps this has been found/fixed already in a later
version. Sorry for all the bother.
>
> Make that Neil. Sorry!

I see the same error in the Error Console on TB 12.0.1:

Error: An error occurred updating the cmd_delete command: [Exception...
"'[JavaScript Error: "goSetMenuValue is not defined" {file:
"chrome://messenger/content/addressbook/abResultsPane.js" line: 404}]'
when calling method: [nsIController::isCommandEnabled]"  nsresult:
"0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS
frame :: chrome://global/content/globalOverlay.js :: goUpdateCommand ::
line 80"  data: yes]
Source file: chrome://global/content/globalOverlay.js
Line: 86

Onno
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: "Hooking" Thunderbird's AbDelete() command

whitedavidp
Onno Ekker wrote:

> Op 31-5-2012 2:09 schreef [hidden email] het volgende:
>> [hidden email] wrote:
>>> Well I'll be darned! After reading Neal's comment I got to thinking.
> I restarted in safe-mode and the problem still exists. So it is not
> really a result of anything I am doing after all. I just never noticed
> this before. Perhaps this has been found/fixed already in a later
> version. Sorry for all the bother.
>> Make that Neil. Sorry!
>
> I see the same error in the Error Console on TB 12.0.1:
>
> Error: An error occurred updating the cmd_delete command: [Exception...
> "'[JavaScript Error: "goSetMenuValue is not defined" {file:
> "chrome://messenger/content/addressbook/abResultsPane.js" line: 404}]'
> when calling method: [nsIController::isCommandEnabled]"  nsresult:
> "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS
> frame :: chrome://global/content/globalOverlay.js :: goUpdateCommand ::
> line 80"  data: yes]
> Source file: chrome://global/content/globalOverlay.js
> Line: 86
>
> Onno

I went ahead and issued a bug report on this yesterday.
<https://bugzilla.mozilla.org/show_bug.cgi?id=759958>
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird