Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
716 views
in Technique[技术] by (71.8m points)

caching - Faster way to modify chrome extension than Remove -> Load unpacked

I have found that the only sure way to test modifications I do to my extension, as I develop it, is to fully Remove it from my extensions and "Load unpacked extension" anew.

Any other shortcut method, and issues with cache crop up, such as it using the old version of my script.

So are there other, faster surefire solutions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What I do for my extension, if it is a change to popup icon or favicon but NOT 48x48 shown in chrome://extensions is a simple reload extension. if you need to view changes to the 48x48 icon, I find you need to fully close and re-open chrome (background apps linger after closing chrome, such as offline mail or calendar or docs)

If you change source code and it isn't noticing the change with a simple refresh, (Maybe in the case of a content script) then I would disable then enable the extension, and if that doesn't work, reload the extension and then close/open chrome.

That should hopefully give you a few things to try, as I fully understand the pain of removing and then adding an extension, and closing and re-opening chrome is not ideal either. For that, I perhaps recommend having two installs of Chrome, either stable and Chrome Canary for development or you could use Chromium for developing

There are lot's of options! but separating developing and normal browsing is a good idea, just don't forget to test on a stable build as well!

For inline css (not added in the document head) closing and re-opening chrome (or removing re-adding the extension) is required. A simple refresh, enable/disable, close/open tab will not suffice.

If you are using Chrome Stable, you won't have access to many features I use as a developer like Chrome Profiles so I would recommend looking into getting either Chromium or Canary for developer purposes, because as a developer you do need to close/re-open the browser a lot (As I find it easier than re-loading an extension)

Addition 11/30/2011 For changing CSS values on an extension tab (options page, anything that appears as a tab), on windows use shift+F5 which clears the cache allowing new CSS to be displayed. This works in Chrome Canary with the disable cache option in the developer tools checked.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...