1

I'm trying to build a chrome extension, based on this one

so I have two files: manifest.json and sample.js

I make some changes on sample.js, they sometimes apply when I reload the page, sometimes don't. I try clearing the cache. Again, it sometimes work. Now I'm completely stuck.

Let's say I try to alert something when clicked on a context menu,

function onClickHandler(info, tab) {
 alert("1");
}

then I change it to

function onClickHandler(info, tab) {
 alert("2");
}

but it keeps alerting 1.

I try clearing the cache, closing and re opening Chrome, even uninstalling and re-installing the extension. Nothing works.

I hope I made myself clear. How do I make sure that the extension is up to date with my sample.js file?

Do I need to disable javascript cache somewhere ?

Thanks for any help..

1

1 Answer 1

3

You should go to chrome://extensions/ and click "Reload" for your extension. (or press Ctrl/Cmd+R but that will reload all your development extensions which might take longer if you have a bunch)

It's the best way to make sure all your extension files are reloaded.

Another way is to use something like Extensions Reloader. It's an extension that adds a button to your toolbar which will reload your extensions for you. (except for changes to manifest.json, which shouldn't be a problem since that's not the file you'll change the most)

Sign up to request clarification or add additional context in comments.

4 Comments

Manually reloading is ok, I only have one. I just need a 100% sure way to have the latest code running. I will give that extension a try, if reload does not work. Thanks !
In that case, going to chrome://extensions/ is the way to go.
Yep, it worked. I will accept your answer in 2 minutes. Thanks again !
Note that the Reload button (circle arrow icon) is only visible, when there are no errors. (The Error Button appears next to the Remove Button.) Also, you need to press "clear errors" after reloading; they don't clear automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.