Using chrome extension apis in typescript

前端 未结 5 1552
广开言路
广开言路 2021-01-30 09:17

I\'m building a chrome extension written in TypeScript. I\'m using WebStorm and I added the chrome-DefiniteltyTyped library in my project.

However, when I w

5条回答
  •  一生所求
    2021-01-30 09:39

    I just ran into the below error when trying to develop a Chrome extension using TypeScript in VS Code and all I had to do was simply run:

    npm install --save-dev @types/chrome

    This will enter "@types/chrome": "0.0.120" under "devDependencies" in your package.json file.

    Fixed error:

    [tsl] ERROR in C:\Users\my_user\Documents\my_chrome_extension\src\content.ts(28,3) TS2304: Cannot find name 'chrome'.

提交回复
热议问题