daydream icon indicating copy to clipboard operation
daydream copied to clipboard

Content script execution problem?

Open International opened this issue 7 years ago • 0 comments

Hi!

I tried the extension and I am curious about the behaviour of the content script. I tried to run the extension on a react app, and I noticed that it could not record me typing stuff into the input box.

I've added a few console.log statements to see what's happening, and this part:

    const inputs = document.querySelectorAll('input, textarea')
    console.log('inputs', inputs)

returns 0. Basically, it means that it tries to bind the listeners before the react app has actually booted, hence no inputs exist on the page.

Is there a reason why the extension works this way? Wouldn't it be better for the content script to bind listeners only once the badge has been clicked? At least the user would be aware whether or not DOM has completely loaded.

International avatar Oct 04 '17 18:10 International