Monday, May 20, 2024
32
rated 0 times [  38] [ 6]  / answers: 1 / hits: 33598  / 9 Years ago, wed, march 4, 2015, 12:00:00

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 write this in my typescript code : chrome.extension.getURL
I got an error : cannot find name 'chrome'.



Because of this, my javascript file is not generated and I cannot use it in my extension.



Do you guys have any solution?


More From » google-chrome

 Answers
7

That should work fine : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chrome/index.d.ts



TIP: make sure you have a reference tag added:



/// <reference path=pathTo/chrome.d.ts/>


[#67583] Sunday, March 1, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
myrap

Total Points: 407
Total Questions: 105
Total Answers: 109

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
myrap questions
Tue, Feb 8, 22, 00:00, 2 Years ago
Wed, Jan 15, 20, 00:00, 4 Years ago
Thu, Oct 24, 19, 00:00, 5 Years ago
Thu, Oct 3, 19, 00:00, 5 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;