I m developing an extension in Chrome 4 (currently 4.0.249.0) that will show the user s StackOverflow/SuperUser/ServerFault reputation in the status bar. I ve designed an options page to get the user s profile IDs and I save them to localStorage and read them well in the extension. It all works great.
The problem is I cannot find a (programmatic) way to refresh the extension upon options saving. I tried calling location.reload();
from the extension page itself upon right clicking it - to no avail. I pursued it further and tried looking at what Chrome s chrome://extensions/
page does to reload an extension, and found this code:
/**
* Handles a reload button getting clicked.
*/
function handleReloadExtension(node) {
// Tell the C++ ExtensionDOMHandler to reload the extension.
chrome.send( reload , [node.extensionId]);
}
我将这部法典复制给我的活动的手稿并不有用(而且是,我尝试用实际代码取代<代码>。 请允许我协助我以正确的方式这样做,或向我指出,这种延长是正确的? 一旦完成,我就把延期及其来源放在我的博客上。