Improve embedded form support in iframes#3010
Improve embedded form support in iframes#3010k4sperski wants to merge 6 commits intoAutomattic:masterfrom
Conversation
|
One thing I want to flag explicitly is the scope of the new |
|
Another good example found here on applications form on careers page |
|
Awesome! I wonder if this will also address #2077? |
elijah-potter
left a comment
There was a problem hiding this comment.
This looks great! Overall, your work is quite legible, but I'd like to see some more explicit documentation. Just a few tweaks and this will be ready to merge.
As for the callback, it's a small enough change that I don't think it really matters if its in scope. It doesn't meaningfully adjust the amount of effort it takes to review the PR. Keep it.
|
Hi @elijah-potter! Thank you for the review. By “scope,” I meant that the new fallback
|


Issues
Related: Discussion #2990
Depends on: PR #2998 for the full end-to-end behaviour on pages that replace the body/DOM after load.
Description
User Impact
This PR improves Harper's behaviour in embedded third-party forms in the chrome extension.
Before this patch:
After this patch:
www.keys continue to work for parent-origin fallbackTechnical Details
This PR makes two focused changes that are needed for the end-to-end embedded-form flow:
Parent-origin inheritance for iframe lint requests:
If an iframe host does not have an explicit stored setting, Harper now falls back to the top-level tab host and allows linting when that parent domain is enabled.
This remains a narrow lookup change:
Focus-based attachment for lazily revealed textareas:
Some embedded form providers only insert or reveal the actual textarea after the user interacts with the form. To cover that flow, the content script now also attaches to eligible textareas (
HTMLTextAreaElement) when they receive focus.I also aligned the background read path with the popup's existing
www.behaviour. When the parent page iswww.example.com, background lookups now also check the popup-styleexample.comkey during reads.Demo
One concrete example is the embedded Greenhouse form on emnify page.
In this example part of the manual-entry flow is revealed only after user clicks
Enter manuallycausing textarea to appear after Harper's normal initial scan window, which is why the focus-based attachment fallback matters here.How Has This Been Tested?
I verified this locally with extension builds and Playwright coverage. The new iframe inheritance coverage includes:
www.parent host when the stored key follows the popup's existingwww.-stripped patternThe dynamic textarea regression verifies that Harper still attaches after the textarea is inserted or revealed after the normal initial scan window.
Firefox notes:
Checklist