How would I iterate through all tabs a user has open and then check if they have a particular HTML item with id = 'item'
?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You can make it like this :
After that to look after your item, if you can make it like this :
Don't forget that you can't manipulate the HTML by using the "background page" So the first code snip is for the background page, and the second have to be on a content script ;)
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:
Passing an empty
queryInfo
parameter would return all of the tabs.I use this one