Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting Global DFL #532

Open
FineWolf opened this issue Feb 3, 2024 · 0 comments
Open

Detecting Global DFL #532

FineWolf opened this issue Feb 3, 2024 · 0 comments

Comments

@FineWolf
Copy link
Contributor

FineWolf commented Feb 3, 2024

Since all plugins are supposed to be compiled as IIFEs, you can test if they are using the global DFL or not by analyzing the output binary.

A cheap but good enough way of doing so if the following:

tail -n1 dist/index.js | grep -Eq '\(([^)]+,\s*)?((globalThis|window)\.)?DFL(,[^)]+)?\)+;?$'

This verifies that the last line of the script self-executes itself by passing in DFL. An exit status of 0 means that global DFL is used, 1 means it isn't.

It should account for different ways of writing IIFEs (not just rollup's).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant