Rothera / bpm

BetterPonymotes
GNU Affero General Public License v3.0
21 stars 23 forks source link

Firefox WebExtension version semi-randomly fails with `document.head is null` #56

Open Jibodeah opened 6 years ago

Jibodeah commented 6 years ago

Semi-randomly on page load BPM crashes with

BPM: ERROR: Exception on line 2918:  TypeError: document.head is null

Looking at the source the problem seems to be in a Chrome specific workaround which probably shouldn't be running anyway...

Firefox 57.0

Jibodeah commented 6 years ago

It seems to occur when a new tab is opened. On the second load of a page in a tab (whether it's a refresh or a new page) it always seems to work properly.

ByzantineFailure commented 6 years ago

I wonder if this happens because our content now doesn't wait for Dom content loaded to work. I had to work around something similar when porting to edge.

On Dec 2, 2017 04:25, "Jibodeah" notifications@github.com wrote:

It seems to occur when a new tab is opened. On the second load of a page in a tab (whether it's a refresh or a new page) it always seems to work properly.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rothera/bpm/issues/56#issuecomment-348688743, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwr6Y60d2If8M9BepBMryj_9kO-lWTCks5s8UHKgaJpZM4QfdQL .

ByzantineFailure commented 6 years ago

Ah, yes. Set the run_at value in the manifest to document_end rather than document_start and that should do it.

On Nov 15, 2017 11:37, "Jibodeah" notifications@github.com wrote:

Semi-randomly on page load BPM crashes with

BPM: ERROR: Exception on line 2918: TypeError: document.head is null

Looking at the source the problem seems to be in a Chrome specific workaround which probably shouldn't be running anyway...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rothera/bpm/issues/56, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwr6VZxOFZm_0sU58Esfv79D-5U3Jehks5s2z1egaJpZM4QfdQL .