Skip to content

Conversation

danielhjacobs
Copy link
Contributor

@danielhjacobs danielhjacobs commented Aug 18, 2025

The purpose is so if a single page has some content that works with Ruffle and some that does not you can add this directly to the embeds that don't work, or even to some parent div of all the embeds that don't work with Ruffle. It still can be ignored with the "Play Flash content even on sites that disallow Ruffle" toggle.

Before this, you could only opt-out of Ruffle page-wide with data-ruffle-optout on the https://developer.mozilla.org/en-US/docs/Web/API/Document/documentElement of the page or iframe.

Requested on Discord.

@danielhjacobs
Copy link
Contributor Author

danielhjacobs commented Aug 18, 2025

Just looked at old issues, so adding:

Addresses #10785 (not called ruffle-skip, just re-using data-ruffle-optout)

Edit: Actually, I'm not sure that's what is meant by the request. They say "This would be useful for cases where certain objects in a SWF file should not be displayed or processed by Ruffle." That doesn't quite match what I'm implementing.

@danielhjacobs danielhjacobs force-pushed the data-ruffle-optout-extension branch from 96e01cf to 1bdb688 Compare August 18, 2025 20:32
@danielhjacobs danielhjacobs added A-web Area: Web & Extensions T-feature Type: New Feature (that Flash doesn't have) labels Aug 18, 2025
@kjarosh
Copy link
Member

kjarosh commented Aug 25, 2025

What about the existing checkPageOptout? Is it still needed?

Comment on lines +224 to +226
// We could try to pass the config specific to this element all the way
// but only the extension can set ignoreOptout and when it does
// it gets added to the global RufflePlayer config, so this is simpler.
Copy link
Member

@kjarosh kjarosh Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look good to me, isn't the page able to override the extension's choice this way if it wanted to?

Copy link
Member

@n0samu n0samu Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, what the comment is saying is that we're not checking the <ruffle-player> element's config, but that's irrelevant because that's not what the extension sets! (for this particular config option, anyway)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, to me that comment suggests we could pass the config from within the code, but we aren't doing that because it's simpler to use the global config, which will also have these properties.

The issue I see here is that the global object could be modified by the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-web Area: Web & Extensions T-feature Type: New Feature (that Flash doesn't have)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants