Hello guys,
I’m experiencing odd behavior when promise is not resolved and there is no error.
But it’s happening only my Nightly and Developer Edition with my normal profile.
When I try it with a clean profile, it works as expected.
Could you try to execute this code in any extension page to see if it will print “result is Array [456]” or if it’s just gonna print “executing script NOW”.
await (async () => {
const currentTabId = (await browser.tabs.getCurrent()).id;
const duplicateId = (await browser.tabs.duplicate(currentTabId)).id;
await new Promise(resolve => setTimeout(resolve, 2000));
console.log('executing script NOW');
const result = await browser.tabs.executeScript(duplicateId, {
runAt: 'document_idle',
code: `window.innerHeight`,
}).catch(e => 'error ' + e);
console.log('result is', result);
})()
Thanks!