lib-iitc-manager
    Preparing search index...

    Function wrapPluginCode

    • Wraps plugin code in an IIFE with GM API bindings.

      The wrapped code calls window.__iitc_gm__({ data_key, meta }) to obtain a GM API instance, then exposes GM_info, GM_getValue, GM_setValue, GM_xmlhttpRequest, etc. as local variables available to the plugin code.

      __iitc_gm__ is only the internal page-level name (chosen to avoid colliding with third-party globals). Plugins still use the familiar GM / GM_* names, since the factory result is passed into the IIFE as the GM argument.

      Parameters

      • plugin: Plugin

        Plugin object from lib-iitc-manager.

      • sourceUrlPrefix: string = ''

      Returns string

      Wrapped plugin code ready for injection.