Skip to content

Detecting Global DFL #532

@FineWolf

Description

@FineWolf

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions