diff --git a/chrome/content/zotero/attachLink.js b/chrome/content/zotero/attachLink.js index c6fe5a3e56..e48dba14fd 100644 --- a/chrome/content/zotero/attachLink.js +++ b/chrome/content/zotero/attachLink.js @@ -24,6 +24,14 @@ */ var Zotero_AttachLink = new function() { + this.load = function () { + document.addEventListener('dialogaccept', (event) => { + if (!this.submit()) { + event.preventDefault(); + } + }); + }; + function getAttachFileLabel() { return window.opener.document .getElementById('zotero-tb-attachment-add-file-link') diff --git a/chrome/content/zotero/attachLink.xul b/chrome/content/zotero/attachLink.xhtml similarity index 72% rename from chrome/content/zotero/attachLink.xul rename to chrome/content/zotero/attachLink.xhtml index 4e39dc7c39..3a5b7877ec 100644 --- a/chrome/content/zotero/attachLink.xul +++ b/chrome/content/zotero/attachLink.xhtml @@ -4,14 +4,14 @@ - + onload="Zotero_AttachLink.load()"> +