Skip to content

fix(Player): Add support for new variants#1152

Merged
LuanRT merged 12 commits intomainfrom
fix/nsig
Mar 16, 2026
Merged

fix(Player): Add support for new variants#1152
LuanRT merged 12 commits intomainfrom
fix/nsig

Conversation

@LuanRT
Copy link
Owner

@LuanRT LuanRT commented Mar 15, 2026

Added support for the recent player js variants.


Surprisingly, this didn't require many changes to get working properly. Aside from fixing a few nasty bugs, I just had to add support for prototype aliases and ES6 classes (and update the matcher, obviously). I also threw in a few misc changes.

To summarize:

  • Updated JsAnalyzer to correctly attribute member assignments made through aliases (e.g., tracking a.b.foo = ... after a.b = g.c.prototype).
  • Improved dependency analysis to handle additional AST node types (such as ClassExpression), ignore irrelevant identifiers (e.g., class method names, meta properties), and correctly manage block scopes for for statements.
  • Corrected scope assignment for var declarations.
  • You no longer have to manually call decipher functions when setting up the Platform.shim.eval fn, a simple return new Function(data.output)(); is enough.

It works fine for my use cases (& env), but I changed some of the global var stuff included the output code, so more testing is welcome (CC @absidue):
image

LuanRT added 10 commits March 15, 2026 10:56
…nments

Plus, a few misc improvements here and there.
A small, separate helper. Why? Because I'd like to keep n/sig specific stuff out of the analyzer and extractor, as they are supposed to be generic and agnostic.

This is also so the user doesn't have to connect the dots themselves when setting up their js interpreters.
…e, unrelated)

Unrelated. Updated it for testing some things.
For consistency.
@LuanRT LuanRT linked an issue Mar 15, 2026 that may be closed by this pull request
4 tasks
I had other plans for this... Not anymore, though.
Copy link
Collaborator

@absidue absidue left a comment

Choose a reason for hiding this comment

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

Code looks good! The documentation about Platform.shim.eval will need to be updated. I will do some testing in FreeTube before I approve the PR.

@LuanRT LuanRT merged commit d8558af into main Mar 16, 2026
3 of 4 checks passed
@LuanRT LuanRT deleted the fix/nsig branch March 16, 2026 10:16
@ndgsa
Copy link

ndgsa commented Mar 16, 2026

How to use extracted nsigFunction?
Why not leave old format sigFunction, nFunction?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exportedVars.nFunction is not a function

3 participants