question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to input rich text to editor in an iframe?

See original GitHub issue

Have open the page,which have the iframe

<iframe id="ueditor_0" allowtransparency="true" width="100%" height="100%" frameborder="0" src="javascript:void(function(){document.open();document.write(&quot;<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml' ><head><style type='text/css'>body{font-family:sans-serif;}</style><link rel='stylesheet' type='text/css' href='https://res.wx.qq.com/mpres/zh_CN/htmledition/comm_htmledition/style/widget/ueditor_new/themes/iframe3f3927.css'/></head><body class='view' lang='en' ></body><script type='text/javascript'  id='_initialScript'>setTimeout(function(){window.parent.UE.instants['ueditorInstant0']._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);</script></html>&quot;);document.close();}())" style="height: 400px;"></iframe>

now once open the web page , I run

await page.click('#ueditor_0');
await page.focus('#ueditor_0');
await page.keyboard.type(clipboardy.readSync());// read from clipboard content which is from one copied page( markdown html page including image)

which only paste the text,no formated text and image .

How do paste the rich text to the editor in iframe? I also tried the keyboard combo ctrl + v (on macos), but get nothing

await page.keyboard.down('Meta');
await page.keyboard.press('KeyV');
await page.keyboard.up('Meta');

Notes: it is ok to use the ctrl +A by the puppeteer keyboard to select all in the editor

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
inevitycommented, Dec 13, 2018
const editFrame = await page.frames().find(f => f.name() === 'ueditor_0');
const inputb = await editFrame.$('#html'); 

// replace f.name()=== as frame api or use eval to use raw html api.

0reactions
stale[bot]commented, Jul 27, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

IFrame Rendering in JavaScript RichTextEditor control
When the iframeSettings option is enabled, the Rich Text Editor creates the iframe element as the content area on control initialization; ...
Read more >
Inserting an iFrame with the rich text editor - Overview - IBM
Insert the cursor in the Entry field where you want the iFrame to be displayed. Click the Insert iFrame icon in the editor...
Read more >
Inserting an iFrame with the rich text editor
Insert the cursor in the Entry field where you want the iFrame to be displayed. ; Click the Insert iFrame icon in the...
Read more >
How to input rich text to editor in an iframe? #3611 - GitHub
Have open the page,which have the iframe.
Read more >
Embed an iFrame through Rich Text Content
The iframe tag is not one of the supported HTML tags and attributes available in a rich text field. You could use a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found