1

I'd like to use GLSL shaders to style a DOM element. I'm googling around and all I find are ways to include WebGl canvases into the DOM, and nothing about going the other way around.

Is there any way of passing the DOM as a texture to a shader?

1 Answer 1

1

No, because it would be a major security breach.

The most you can do is use a library to render the dom to a canvas

Sign up to request clarification or add additional context in comments.

2 Comments

That's super unfortunate. Do you happen to know what I could read to understand the security issues? Is there any hope of shaders ever being added in some limited form? (from what I understand, 'CSS shaders' were abandoned?)
Yes, CSS shaders were abandoned. Too much work, not really useful, all kinds of issues. As for security the issue was you could read the contents the DOM elements by timing draw calls and making the shader take more time depending on its colors. By doing so you can read the contents of an iframe from another domain or read which links have been followed etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.