Reputation: 1
In my currently writing Thunderbird 68.5.0's addon, the dialog's event handlers both ondialogaccept and ondialogcancel are not fired for unknown reasons.
When clicking the "strangers" button on the sample dialog, the alert is shown. However clicking the "Accept" button or the "Cancel" button, any alert is not.
The just written code is as follows:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="sample" title="event handlers"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
ondialogaccept="window.alert('Hi!');return true;"
ondialogcancel="window.alert('Oops!');return true;"
>
<button label="strangers" onclick="window.alert('Yip Yip!');" />
</dialog>
// launcher.js
window.openDialog(
"chrome://myaddon/content/sample.xul",
"sampleDlg",
"resizable,chrome,modal,titlebar,centerscreen");
Thank you in advance.
Upvotes: 0
Views: 37
Reputation: 57
In TB68, the on... handlers do no longer work due to CSP. In your javascript, you need to load a listener to the event. See the update info to TB 60 in mozilla TB wiki and/or the upgrade info on developer.thunderbird.net
Klaus
Upvotes: 0