fix "Element picker/zapper does not switch tabs" in https://github.com/uBlockOrigin/uBlock-issues/issues/168

This commit is contained in:
Raymond Hill 2018-08-14 20:14:13 -04:00
parent e262bb548c
commit 5bd18f1edc
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 14 additions and 4 deletions

View File

@ -400,10 +400,20 @@ var matchBucket = function(url, hostname, bucket, start) {
this.epickerTarget = targetElement || '';
this.epickerZap = zap || false;
vAPI.tabs.injectScript(tabId, {
// https://github.com/uBlockOrigin/uBlock-issues/issues/168
// Force activate the target tab once the element picker has been
// injected.
vAPI.tabs.injectScript(
tabId,
{
file: '/js/scriptlets/element-picker.js',
runAt: 'document_end'
});
},
( ) => {
vAPI.tabs.select(tabId);
}
);
};
/******************************************************************************/