extension: Remove raw script injection functions #22793
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These functions have always been a hack. Before MV3 and its support for ExecutionWorld MAIN, they were necessary to "pierce through the isolated sandbox of web extensions" (more accurately they add a script as a page object which itself has access to page globals) in order to modify global objects like
navigator.pluginsandwindow.RufflePlayer.ExecutionWorldMAINis the true intended way of gaining this ability. This will lose us support for Firefox versions prior to 128, which notably includes the last supported Windows 7/8 version of Firefox, Firefox 115 ESR. That is why it's a draft. Firefox 115 ESR will go out of support after February 2026. This date has been repeatedly pushed back, but this is likely the final date, as previous versions of https://support.mozilla.org/en-US/kb/firefox-users-windows-7-8-and-81-moving-extended-support said the date would be re-evaluated closer to it occurring, but the current version says "After this, no security updates will be provided and you are strongly encouraged to upgrade to a supported Microsoft Windows version." It seems reasonable for us to end support for Firefox 115 ESR when Mozilla ends support for it.