1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-18 08:52:26 +02:00

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

View File

@ -400,10 +400,20 @@ var matchBucket = function(url, hostname, bucket, start) {
this.epickerTarget = targetElement || '';
this.epickerZap = zap || false;
vAPI.tabs.injectScript(tabId, {
file: '/js/scriptlets/element-picker.js',
runAt: 'document_end'
});
// 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);
}
);
};
/******************************************************************************/