DEV Community

Discussion on: Reading files in a Chrome Extension

Collapse
 
kathychurch profile image
Kathy Church

I am new to Chrome Extensions and this is just the info I was looking for. However, I'm having trouble using the chrome.runtime.getUrl function. Whenever I try to use it in a content_script I get:

Uncaught TypeError: chrome.runtime.getUrl is not a function

Do you have an example that shows your complete manifest and script file where this is working?

Collapse
 
aussieguy profile image
Anthony Bruno

Hey there!

It looks like you picked up a typo from me. The method is called chrome.runtime.getURL (url is capitalized!). Sorry about that!

If you want to look at an example have a look at my repo: github.com/AussieGuy0/fill-it-in. A instance where I getURL is: github.com/AussieGuy0/fill-it-in/b...

Collapse
 
kathychurch profile image
Kathy Church

Thanks!