Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruffle object has no width and height properties available #13176

Closed
robinheidrich opened this issue Sep 13, 2023 · 2 comments
Closed

Ruffle object has no width and height properties available #13176

robinheidrich opened this issue Sep 13, 2023 · 2 comments
Labels
A-web Area: Web & Extensions enhancement New feature or request

Comments

@robinheidrich
Copy link

The <object> tag has width and height properties available (see here), but since <ruffle-object> is not a real object it does not. For compatibility reasons, it might be a good idea to do this (if possible).

For example, I use a JavaScript code to adapt the object to the screen size (to make it responsive to the website) using the width and height properties of the object.

If this is not planned, I would have to fallback to clientWidth and clientHeight 🙁.

document.querySelector("object").height
480
document.querySelector("ruffle-object").height
undefined

Tested in Chrome 117.

@robinheidrich robinheidrich added the enhancement New feature or request label Sep 13, 2023
@Lord-McSweeney Lord-McSweeney added the A-web Area: Web & Extensions label Sep 13, 2023
@danielhjacobs
Copy link
Contributor

Worth noting document.querySelector("ruffle-embed, ruffle-object, ruffle-player").getAttribute("height") does work. But you're right that for compatibility with Flash this should probably be a thing.

@danielhjacobs
Copy link
Contributor

danielhjacobs commented Sep 13, 2023

adrian17 pushed a commit to danielhjacobs/ruffle that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web Area: Web & Extensions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants