As content script has its own limitations,
chrome.tabs
is only available in background scripts and popup scripts.
If you wanna to use chrome.tabs
then pass message from content_script to background script and play with chrome.tabs
.
More Related Contents:
- How can I get the current Crome URL?
- Chrome extension that enables chatting with users on same page [closed]
- Persistent Service Worker in Chrome Extension
- How to wait until an element exists?
- How to use jQuery in chrome extension?
- Chrome extension: How to save a file on disk
- Chrome Extension: Port error: Could not establish connection. Receiving end does not exist.
- Contexts and methods for communication between the browser action, background scripts, and content scripts of chrome extensions?
- Chrome Extension: Make it run every page load
- Chrome Extension: Get Page Variables in Content Script
- saving and retrieving from chrome.storage.sync
- How to make side panel in chrome extension?
- Does extension messaging like chrome.runtime.sendMessage internally use JSON.stringify?
- google chrome extension :: console.log() from background page?
- Can I prevent an alert() with a Google Chrome Extension
- How can I save information locally in my chrome extension?
- How to get the currently opened tab’s URL in my page action popup?
- How to get errors stack trace in Chrome extension content script?
- How do I send an HTTP request from a Chrome extension?
- Sending message to background script
- Pass a variable from content script to popup
- Prevent window.open from focusing
- Associate a custom user agent to a specific Google Chrome page/tab
- How to clear chrome.storage.local and chrome.storage.sync?
- How to fix chrome-extension inline JavaScript invocation error?
- Can a website block a Chrome Extension? [duplicate]
- Chrome extension identity.email empty
- Can’t pass arguments to chrome.declarativeContent.SetIcon
- Where are cookies saved for a local HTML file?
- Chrome Extension get selected text