Skip to content Skip to sidebar Skip to footer

Chrome.tabs.getSelected Is Undefined On Latest Chrome That Uses Manifest Version 2?

I'm trying to create a plugin, that uses chrome.tabs.getSelected to find current URL, Below I attached a minimal example, when any key is pressed, a dialog will popup, but it kept

Solution 1:

EDIT: Sorry, just realized you can't use chrome.tabs in a content script. You'll have to message the extension's background page for access to that. Here's some info about messaging: https://developer.chrome.com/extensions/messaging.html.


Post a Comment for "Chrome.tabs.getSelected Is Undefined On Latest Chrome That Uses Manifest Version 2?"