{"size": 1092, "ext": "js", "max_stars_repo_path": "src/GetInstalledBundleVersion.js", "max_stars_repo_name": "GoodBoyNinja/CEP-Goofs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/GetInstalledBundleVersion.js", "max_issues_repo_name": "GoodBoyNinja/CEP-Goofs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/GetInstalledBundleVersion.js", "max_forks_repo_name": "GoodBoyNinja/CEP-Goofs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 40.4444444444, "max_line_length": 108, "alphanum_fraction": 0.6666666667}
/*requires having nodejs enabled in the manifest file:
  <CEFCommandLine>
      <Parameter>--enable-nodejs</Parameter>
    </CEFCommandLine>
    
also assumes your manifest file is in /CSXS/manifest.xml relative to your extension root folder
*/

this.getInstalledPanelVersion = function () {
        const fs = cep_node.require('fs');
        const path = cep_node.require('path');
  
        var extension_dir = decodeURI(window.__adobe_cep__.getSystemPath(SystemPath.EXTENSION));
        if (navigator.platform.toLowerCase().indexOf("win") >= 0) {
            extension_dir = extension_dir.replace("file:///", "");
        } else {
            extension_dir = extension_dir.replace("file://", "");
        }
  
        const manifest_path = path.join(extension_dir, "CSXS", "manifest.xml");
        const manifest_str = fs.readFileSync(manifest_path, "utf8");
  
        const parser = new DOMParser();
        const manifest = parser.parseFromString(manifest_str, "text/xml");
        return manifest.getElementsByTagName("ExtensionManifest")[0].getAttribute("ExtensionBundleVersion");
};
