Open alexwh opened 6 months ago
This also doesn't work for me as well. The email content does not highlight nor does the popup load at all in Protonmail. However, the rest of the page, including the Protonmail email composer, scans perfectly fine.
I took a look at the DOM structure and noticed the email content is basically loaded in an
Here are my current specs:
Browser version Chromium 118.0.5993.88(Official Build, ungoogled-chromium)
Yomitan version 24.6.17.0
Exported settings file yomitan-settings-2024-06-21-07-00-21.json
I think this is a related issue https://github.com/themoeway/yomitan/issues/499
I did a little bit more investigating and created a minimal example to reproduce this bug. Protonmail loads email content as a new html document in an <iframe>
.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script>
function loadFrame() {
const content = `<!DOCTYPE html>
<html lang="ja">
<head><meta charset="utf-8"></head>
<body>
<div>読めない!</div>
</body>
</html>
`;
const iframe = document.getElementById("frame");
const doc = iframe.contentDocument || iframe.contentWindow.document;
doc.open();
doc.write(content);
doc.close();
}
</script>
</head>
<body onload="loadFrame()">
<div>テレビです</div>
<iframe
id="frame"
frameborder="0"
sandbox="allow-same-origin allow-popups allow-popups-to-escape-sandbox">
</iframe>
</body>
</html>
The 読めない text cannot be scanned by Yomitan.
If you add the value "allow-scripts"
to the sandbox
attribute of the iframe, the 読めない text becomes scannable by Yomitan.
Though interestingly, you cannot just hack in this value in the browser dev tools to get Yomitan scanning to temporarily work.
Description Copying from Yomichan issue https://github.com/FooSoft/yomichan/issues/2264
When trying to load Yomitan in Protonmail email content, the popup does not appear. There are no errors in console unlike with Yomichan. Interestingly, Yomichan's behavior highlights the text but then fails to display the popup, whereas Yomitan does not highlight at all. Other parts of the page that are not part of the email content iframe function correctly. Changing either of the iframe security related options does not seem to help.
Browser version Firefox 121.0
Yomitan version 23.11.23.0
Exported settings file yomitan-settings-2023-12-22-11-58-44.txt