FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.07k stars 229 forks source link

[Bug Report] Not working in dynamically created windows (Firefox) #1870

Open RicBent opened 3 years ago

RicBent commented 3 years ago

Description

On Firefox Yomichan does not work in dynamically created windows/popups. This is not an issue on Chromium.

I assume this may be limitation by the browser, but because I wasn't able to find any Firefox documentation regarding this I still created this issue.

Minimal, Reproducible Example:

var popup = open('', 'Test Popup', 'width=400,height=400');
var testText = popup.document.createElement('p');
testText.appendChild(popup.document.createTextNode('これペンです。'));
popup.document.body.appendChild(testText);

(Run on any website, allow popups)

Browser version Firefox 90.0.1 (64-bit)

Yomichan version 21.6.30.2

toasted-nutbread commented 3 years ago

I can reproduce the issue using the same config you listed, but curiously it works on Firefox 91 Developer Edition. Not sure if this is due to something that changed in Firefox, or if it's related to a slightly different setup for testing. Firefox 91 should release to stable on August 10, so it may be worth waiting a bit to test after that's out.

On Firefox 90 (main release), the main extension script doesn't execute on the popup; on 91 it does.

RicBent commented 3 years ago

I just tested it on a freshly installed 91.0b7 (Developer Edition) and am getting exactly the same behavior as on regular 90.0.1.

Odd. Have you changed any preferences that could affect this?

toasted-nutbread commented 3 years ago

Hmm, you're right, I see the same behaviour now; I must have done something wrong the first time.

I'd assume that this is a bug in Firefox. The popup URL is about:blank, and the extension runs on normal about:blank pages, but not this one. It will even run on the popup if the page is refreshed, but then obviously the content will be lost.

I also get a crash in Chrome when I try on that browser, so it seems both browsers may have bugs.

toasted-nutbread commented 3 years ago

FYI this bug has been reported on Firefox's issue tracker. https://bugzilla.mozilla.org/show_bug.cgi?id=1726068

1899