mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 02:42:41 +01:00
Fix tabs.executeScript() not resolving in due time
Related feedback:
- 6efd8eb84a
This commit is contained in:
parent
0f5384ee0d
commit
d59eeba8e2
@ -609,6 +609,10 @@ const onMessage = function(request, sender, callback) {
|
||||
});
|
||||
return;
|
||||
|
||||
// https://github.com/gorhill/uBlock/commit/6efd8eb#commitcomment-107523558
|
||||
// Important: for whatever reason, not using `document_start` causes the
|
||||
// Promise returned by `tabs.executeScript()` to resolve only when the
|
||||
// associated tab is closed.
|
||||
case 'launchReporter': {
|
||||
const pageStore = µb.pageStoreFromTabId(request.tabId);
|
||||
if ( pageStore === null ) { break; }
|
||||
@ -619,6 +623,7 @@ const onMessage = function(request, sender, callback) {
|
||||
allFrames: true,
|
||||
file: '/js/scriptlets/cosmetic-report.js',
|
||||
matchAboutBlank: true,
|
||||
runAt: 'document_start',
|
||||
}).then(results => {
|
||||
const filters = results.reduce((a, v) => {
|
||||
if ( Array.isArray(v) ) { a.push(...v); }
|
||||
|
Loading…
Reference in New Issue
Block a user