diff --git a/chrome/content/zotero/commonDialog.js b/chrome/content/zotero/commonDialog.js new file mode 100644 index 0000000000..26f0a59637 --- /dev/null +++ b/chrome/content/zotero/commonDialog.js @@ -0,0 +1,14 @@ +window.addEventListener('keypress', function (event) { + if (event.key == 'Escape') { + try { + let elem = document.querySelector('button[dlgtype="cancel"]'); + if (!elem) { + elem = document.getElementById('cancel-button'); + } + elem.click(); + } + catch (e) { + window.close(); + } + } +}); \ No newline at end of file