Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome extension API for refreshing the page

Is there an API to programmatically refresh the current tab from inside a browser action button? I have background page configured, which attaches a listener via:

chrome.browserAction.onClicked.addListener(function(tab) { ... }); 

So the callback function retrieves a reference to the tab that it was clicked from, but I don't see an API anywhere to refresh/reload that tab.

like image 691
chinabuffet Avatar asked Dec 01 '11 14:12

chinabuffet


People also ask

How do I automatically refresh a page in Chrome?

Open the Google Chrome browser and make sure you can access the Deep Security Manager console. Click the three vertical dots on the upper-right corner and select Settings. Select Extensions and click Get more extensions at the bottom of the page. Search for the Auto Reload Page Extension and click Add to Chrome.

How do you refresh Chrome extensions?

1 - The extension's toolbar button. 2 - Browsing to "http://reload.extensions". The toolbar icon will reload unpacked extensions using a single click.


1 Answers

I think what you're looking for is:

chrome.tabs.reload(integer tabId, object reloadProperties, function callback) 

Check out tabs API() documentation for more information.

like image 185
Mitya Avatar answered Oct 05 '22 23:10

Mitya