This article mainly introduces how to use the extension to report an error after the Chrome browser is upgraded to 91, and the error: Unchecked runtime.lastError: Tabs cannot be edited right now (user may be dragging a tab), and related sample code.
problem causes:
After the recent Chrome 91 update, when you try to use chrome.tabs API, extensions given: “Unchecked runtime.lastError: Tabs cannot be edit right (user may be drag a tab)”
.
Solution:
chrome.tabs.onActivated.addListener(function(activeInfo) {getActivatedTab();});
function getActivatedTab() {
chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
try{
if(tabs[0]!=undefined){
console.log(tabs[0].url);
}
}
catch(err){
setTimeout(function() {
getActivatedTab();
}, 100 );
}
})
}
Similar Posts:
- Unchecked runtime.lastError: The message port closed before a response was received.
- Error: [$compile:nonassign] Expression used with directive ‘uibTab’ is non-assignable
- Chrome Commands Error: “Slow network is detected. Fallback font will be used while loading”
- Unable to preventDefault inside passive event listener due to target being treated as passive?
- Solve the chrome driver error original error: Chrome not reachable
- Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi…
- The source code installs the git tool, which shows /usr/local/lib64/libcrypto.a(dso_dlfcn.o) undefined reference to `dlopen’
- Solve the problem of invalid package during chrome plug-in installation: “CRX”_ HEADER_ INVALID”
- Bootstrap switch Uncaught TypeError: Cannot read property ‘apply’ of undefined
- undefined symbol: xxx – undefined reference to `typeinfo