Bug Report: Bypassing the need for user interaction before editing a document



Normally, before editing a document through plugin API, a user must interact with the plugin in some way (e.g. clicking a button), but JavaScript allows us to fake a button “click” through the code using HTMLElement’s click() function, which bypasses this need because that faked button “click” event is considered to have been made by the user. I assume this is not intended to work this way?

Steps to reproduce

const div = document.createElement('div');
div.addEventListener('click', () => {
    // Now we can edit the document without any problems:
    // application.editDocument(...)


// Wait for our <div> to be actually added to the DOM, otherwise
// the click event will not be fired.
setTimeout(() => {

Tested on the latest version (

Whoa, nice workaround of the user-must-initiate rule for editDocument!

Why did you have to spoil it by telling Adobe? :wink:

Thanks for the heads up. This is definitely a bug!