New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 657578 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: 2016-11-21
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

It's impossible to trigger a trusted TextEvent textInput from an extension

Reported by t.rebo...@gmail.com, Oct 19 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

Steps to reproduce the problem:
In the content script of an extension, execute the following code:
const textEvent = document.createEvent('TextEvent')
textEvent.initTextEvent('textInput',
            true,
            true,
            null,
            'myString');
document.activeElement.dispatchEvent(textEvent)

What is the expected behavior?
I expected that a Chrome extension could fire trusted events, and that the textInput TextEvent would trigger the default behaviour.

What went wrong?
Since Chrome 53, synthetic events do not trigger the default behaviour. I understand it is important for a regular website, but coming from the content script of an extension this is really blocking for me.

In Chrome 53 I had a workaround with document.execCommand('insertText', false, 'myString') that worked but shouldn't have. Not so suprisingly it doesn't work in Chrome 54.

Did this work before? Yes 52

Does this work in other browsers? N/A

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: OS X 10.11
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by woxxom@gmail.com, Oct 20 2016

>In Chrome 53 I had a workaround with document.execCommand('insertText', false, 'myString') that worked but shouldn't have. Not so suprisingly it doesn't work in Chrome 54.

Actually, it is surprising, and looks like a regression because Chrome allows insertText/insertHTML on input and textarea elements, see issue 558919 (personally I agree with the comment suggesting Firefox should change its behavior). FWIW, insertText workaround is functional here on Windows (tested in Chrome 53,54,56).

Comment 2 by woxxom@gmail.com, Oct 20 2016

To further prove my point, insertText approach is also recommended by a chromium developer in  issue 648232 .
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback
could you please provide the sample Html file to traige the issue further.


Thanks.
Components: Blink>Input
Labels: -Type-Bug Type-Bug-Regression
Cc: dtapu...@chromium.org
Can you please provide the document where execCommand doesn't work? I've tried both on input fields and inside content editable text and it appears to work fine. Chrome 54.0.2840.71 on OSX 10.11.6
t.rebours@ ping; we are waiting to see the example where execCommand doesn't work.
NextAction: 2016-11-21
We will keep this open until the 21st waiting for an example since we aren't able to reproduce it yet.
Status: WontFix (was: Unconfirmed)
Closing as per #7. No response provided; unable to reproduce.

Sign in to add a comment