Hello there, this message is to report unusual behavior that has been causing issues. This problem might also occur with other extensions. The issue is as follows:
We have two scripts:
Script1
'content_script' is defined in manifest.json with:
runAt set as document_start,
all_frames set as true,
The script1 involves creating a node inside the website DOM.
Script2
A script registered via registerContentScripts API with:
runAt set as 'document_start',
world described as 'MAIN',
allFrames set as true,
The script2 reads the node created by script1.
On all websites, the execution order is consistently Script 1 followed by Script 2. However, after a Chromium update, the execution order switched to Script 2 and then Script 1. This behavior has been consistently reproduced. We mitigated the issue by adding a retry logic to find the node, but we would appreciate understanding the underlying issue.
This problem persists until users update the extension to a newer version or reinstall the extension.
Thanks (Happy to provide a repo with minimal code to reproduce)