Puppeteer 3.3.0 crashes Firefox Nightly 79 when using UTF8 in ElementHandler.type
See original GitHub issueConsider the following script
const puppeteer = require( "puppeteer" );
async function main() {
try {
const browser = await puppeteer.launch({
"product": "firefox",
"headless": false,
"devtools": false,
"slowMo": 30,
"ignoreHTTPSErrors": true,
"executablePath": "/etc/firefox-nightly/firefox"
});
const page = await browser.newPage();
await page.goto( "http://todomvc.com/examples/react/#/" );
const elh = await page.$( "input.new-todo" );
await elh.type( "ưxx111" );
await browser.close();
} catch ( e ) {
console.error( e );
}
}
main();
If I use in await elh.type( "abc" ); any ASCII everything works perfect, but with "ưxx111"
it crashes Firefox with fatal error:
chrome://remote/content/sessions/frame-script.js:12:1
at Promise (/tmp/node_modules/puppeteer/lib/Connection.js:152:63)
at new Promise (<anonymous>)
at CDPSession.send (/tmp/node_modules/puppeteer/lib/Connection.js:151:16)
at Keyboard.sendCharacter (/tmp/node_modules/puppeteer/lib/Input.js:105:28)
at Keyboard.<anonymous> (/tmp/node_modules/puppeteer/lib/helper.js:95:27)
at Keyboard.type (/tmp/node_modules/puppeteer/lib/Input.js:119:28)
at Keyboard.<anonymous> (/tmp/node_modules/puppeteer/lib/helper.js:95:27)
at ElementHandle.type (/tmp/node_modules/puppeteer/lib/JSHandle.js:307:35)
-- ASYNC --
at ElementHandle.<anonymous> (/tmp/node_modules/puppeteer/lib/helper.js:94:19)
at main (/tmp/test.js:16:15)
message:
'Protocol error (Input.insertText): Input.insertText RemoteAgentError@chrome://remote/content/Error.jsm:25:5\n
UnknownMethodError@chrome://remote/content/Error.jsm:108:7\n
execute@chrome://remote/content/domains/DomainCache.jsm:96:13\n
receiveMessage@chrome://remote/content/sessions/ContentProcessSession.jsm:86:45\n
MessageListener.receiveMessage*ContentProcessSession@chrome://remote/content/sessions/ContentProcessSession.jsm:33:25\n
@chrome://remote/content/sessions/frame-script.js:12:1\n' }
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Puppeteer causes Firefox to freeze because stdout/stderr ...
It simply loads the given page, and then quits the browser. But closing the browser hangs, and Firefox never quits. Even the shutdown...
Read more >Puppeteer crashes on browser.close() with: Received signal ...
Same issue. appears to happen only on .close() and the rest of the process runs fine. there are some errors on launch but...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A quick solution is to add into “/puppeteer/lib/cjs/puppeteer/common/USKeyboardLayout.js” the chars you’ll use.
For example, for “ê”, append the line to main object:
ê: { keyCode: 234, key: 'ê', code: 'KeyÊ' },Run this function to generate and paste into the USKeyboardLayout.js:
function charcodes(char) {
}
for(let each of ‘êÊáéíúó’){ console.log(charcodes(each)) }
Hope it helps 😃
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!