aframe-htmlembed-component icon indicating copy to clipboard operation
aframe-htmlembed-component copied to clipboard

Freezing browser during render

Open bknill opened this issue 5 years ago • 7 comments

I'm having problems where the browser is freezing during new renders.

Is there a way to pre-render and cache the image?

Ideally we could use web workers to render in a new thread, but they don't support canvas.

EDIT - Seems you can render offscreen. https://developers.google.com/web/updates/2018/08/offscreen-canvas

I'll see if I can get this working.

bknill avatar Feb 19 '20 22:02 bknill

Ran into a bug in Chrome which means this isn't currently possible because of a tainted canvas.

I'm running this in Aframe 1.0.2.

I notice your examples don't freeze the browser during render, not sure what I'm doing differently.

Do you get a freeze in newer versions of Aframe?

bknill avatar Mar 01 '20 21:03 bknill

I am running into this issue as well. I can ultimately get the html rendering within the scene but it takes an awfully long time and freezes browser during a re-render as mentioned above. I am using aframe-react: 4.4.0 to render the aframe markup with aframe: 1.0.4 as well as chrome: 80.0.3987.132.

aChanEP avatar Mar 10 '20 18:03 aChanEP

@aChanEP yep I had to ditch this because of the freezing. Doesn't seem to be any way around it, especially with dynamically rendered content.

bknill avatar Mar 11 '20 22:03 bknill

@bknill good to know. I did the exact same thing. Thanks!

aChanEP avatar Mar 13 '20 15:03 aChanEP

Hey I ran into this problem in react as well. It's because the component reloads every stylesheet on the page when it's initialized. I forked the project, and added StyleSheetId to the schema to, which lets you specify the specific style sheet that should be reloaded. I made a pull request to integrate the changes.

michaelthatsit avatar Apr 28 '20 06:04 michaelthatsit

Same as #22

lmcarreiro avatar Aug 04 '21 13:08 lmcarreiro

Is there any workaround?

lmcarreiro avatar Aug 04 '21 13:08 lmcarreiro