Skip to content

Polyfilled plugin properties remain configurable - #24312

Open
mincerafter42 wants to merge 2 commits into
ruffle-rs:masterfrom
mincerafter42:master
Open

Polyfilled plugin properties remain configurable#24312
mincerafter42 wants to merge 2 commits into
ruffle-rs:masterfrom
mincerafter42:master

Conversation

@mincerafter42

@mincerafter42 mincerafter42 commented Jul 27, 2026

Copy link
Copy Markdown

Description

Fixes #24311.

This allows additional plugin polyfills or additional code in general (from different scripts or browser extensions) to add to navigator.plugins, navigator.mimeTypes etc. after Ruffle (or to override the properties in any other way, as they normally can do).

Testing

Tests added to web/packages/selfhosted/test/polyfill/spoofing.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

@evilpie

evilpie commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

Adding a test for this shouldn't be too difficult. See e.g. #20033 how that was done.

@evilpie evilpie added A-web Area: Web & Extensions T-fix Type: Bug fix (in something that's supposed to work already) labels Jul 27, 2026
@evilpie

evilpie commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Looks great. If you could follow the commit style we can merge this.

  1. Prefix with web:
  2. Prefix with tests:

This allows multiple plugin polyfills on the same page.
The typical reason for the properties to be defined a second time would be a second plugin spoofer, but for the sake of small and general tests I'm not putting a plugin spoofer in the tests.
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-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web plugin polyfill should make the overriden properties remain configurable

2 participants