adam-p / markdown-here

Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and render it before sending.
http://markdown-here.com
MIT License
59.59k stars 11.26k forks source link

Doesn't work with editors in iframe on Chrome v69 #525

Open cssmagic opened 5 years ago

cssmagic commented 5 years ago

Condition:

After upgrading Chrome to v69, my page can't use markdown-here anymore.

The editor in this page is in a <iframe>, like this:

<html>
<body>
<iframe src="javascript:void(function(){document.open();document.write(&quot;<!DOCTYPE html><html><body><script src='editor.js'></script></body></html>&quot;);document.close();}())">
</iframe>
<body>
</html>

When I write Markdown text in the editor and click "Markdown-Here" button as usual, Markdown-Here alerts "Nothing found to render or revert".

I noticed that when I select text in the editor then click "Markdown-Here" button, the highlight of selection in the editor disappears -- looks like the selection in the iframe lose focus, so Markdown-Here can't find text to render.

Thanks for your attention!

cssmagic commented 5 years ago

Upgraded Markdown-Here to v2.13.3 manually, but still have this problem.

I guess this is Chrome's bug 😂