Search code examples
javascriptvisual-studio-codegoogle-chrome-extension

How to add global variable to vscode?


I'm working on a Chrome extension and I'm getting an error if I write

chrome.storage.sync.set({key: value}, function() {
  console.log('Value is set to ' + value);
});

Because vscode doesn't know it's available in this particular environment. Where can I set it to be like, window, document etc...?


Solution

  • create file jsconfig.json with the following content

    {"typeAcquisition": {"include": ["chrome"]}}