XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

specify static main world script in manifest.json

Open marcustyphoon opened this issue 1 year ago • 4 comments

Description

Yep: this works.

Rather than creating and appending a script element to run the main world script in the correct world, this specifies it as a static content script with the "world": "MAIN" property.

My assumption is that content scripts get injected in order and are executed synchronously...? So there, uh, should be no race conditions with this? Probably?

Requires Firefox 128, which was released today, so we obviously don't want to do this now.

edit: Requiring Firefox 128 is no longer impactful (it's the earliest ESR we support anyway), but requiring Chrome 111 drops our Windows 7 support. If doing so, we may as well go to Chrome 116, as it has the same operating system support.

Testing steps

todo

marcustyphoon avatar Jul 10 '24 07:07 marcustyphoon

  • [x] make main_world script classic, preventing Uncaught SyntaxError: redeclaration of const moduleCache (will be done with #1551 merge)

marcustyphoon avatar Jul 18 '24 12:07 marcustyphoon

I wonder if this is incompatible with #1851 or if Firefox magically handles this case correctly.

Be sure to test Firefox extension update/reload heavily if we do this.

marcustyphoon avatar Jul 25 '25 07:07 marcustyphoon

Aw, I liked the look of this one.

AprilSylph avatar Oct 02 '25 22:10 AprilSylph

I mean, we can definitely do it if we want to standardize on "we don't support windows 7" eventually.

marcustyphoon avatar Oct 02 '25 22:10 marcustyphoon