Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome-Extension: iterate through all tabs?

How would I iterate through all tabs a user has open and then check if they have a particular HTML item with id = 'item'?

like image 281
Skizit Avatar asked Mar 23 '11 17:03

Skizit


People also ask

Can Chrome cycle through tabs automatically?

Auto-refresh is an extension for Google Chrome which monitors the HTTP traffic and if a page fails to load, it auto-refreshes that page. This description specially develop to Switch to next tab & refresh next (+1) tab. The duration of Switch to next tab & refresh next (+1) tab is 20 seconds.

How do I get all tabs in Chrome extension?

var tabs = await chrome. tabs. query({}); tabs. forEach(function (tab) { // do whatever you want with the tab });

What is tab carousel?

Tab carousel which pauses on a window focus. Automatically cycle through your tabs. Useful for monitoring lots of information on a single screen. Unlike other carousels it stops cycling when the window is focused, and start the carousel again when you focus on something else.

How do I create a slideshow in Chrome tabs?

The functionality is simple: press the Tab Slideshow icon in your extension tray, input the interval length (the amount of time to spend on each tab) and press 'Begin'. Tabs will then change automatically after the specified interval of time is up.


1 Answers

It appears this method has been deprecated in favor of chrome.tabs.query:

http://developer.chrome.com/extensions/tabs.html#method-query

So now you'd want to do:

chrome.tabs.query({}, function(tabs) { /* blah */ } ); 

Passing an empty queryInfo parameter would return all of the tabs.

like image 87
Golden Flying Broom Avatar answered Sep 18 '22 11:09

Golden Flying Broom