-
Type: Task
-
Resolution: Gone away
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
1273
-
SDK FY21-Q3, SDK FY21-Q3.
I had this almost working, but forgot that the master branch does not have the latest Electron version.
Add this to src/main/WindowManager.ts and confirm it's working as expected.
Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
import fs from 'fs'; import os from 'os'; function addChromeExtension(id: string) { const extensionRootPath = path.resolve(os.homedir(), `Library/Application Support/Google/Chrome/Default/Extensions/${id}`); try { if (!fs.existsSync(extensionRootPath)) { throw new Error(`Missing (path = ${extensionRootPath})`); } const versionDirectories = fs.readdirSync(extensionRootPath); if (versionDirectories.length > 0) { const versionDirectory = versionDirectories[versionDirectories.length - 1]; const extensionPath = path.resolve(extensionRootPath, versionDirectory); const manifestPath = path.resolve(extensionPath, "manifest.json"); if (!fs.existsSync(manifestPath)) { throw new Error(`Missing manifest (path = ${manifestPath})`); } const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); console.log(`Adding "${manifest.name}" Chrome extension`); BrowserWindow.addDevToolsExtension(extensionPath); } } catch (err) { console.warn(`Skipped adding Chrome extension (id = ${id}): ${err.message}`); } } if (isDevelopment && os.platform() === "darwin") { addChromeExtension("fmkadmapgofadopljbjfkapdkoienihi"); }