vimb
vimb copied to clipboard
External editor in iframes
Opening the external editor to edit form element does not work if those elements are locate inside an iframe.
Steps to reproduce
- Open the test page
vimb tests/manual/editable-focus-in-iframe.html
- Type "hello" into the focussed textarea
- Press CTRL-T to open the external editor
Expected result
- The editor loaded a file containing "hello"
Actual behaviour
- The editor loaded a file containing "undefined"
This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.
The webextension observes all the elements in the page and also those in the included iframes for focus changes in on_editable_change_focus()
. If an element is focused we inform the UI Process about this which calls input_enter()
in the end. In this function we run JS to store the document.activeElement
into separate variable. But the document we reference here is the outer document and not the document of the iframe where the for field belongs to. That means, the activeElement in this case is the iframe itself.
I'll try to set this variable in the webextension when the focus event is observed. So the variable is set on the right document. But then we can't call a JS to get the form field content, because we do not know in which document we have to look for the variable vimb_input_mode_element
. So we need to move the whole get the value from active element and write the editor data back later into the webextension. And I fear that this will not work because of the same origin policy restrictions too. So we might to spent more time to implement this by using the DOM API from within the webextension.
This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.