Supported script file types and loading behavior
masterThe loader (boot.sys.mjs) automatically detects and loads three types of scripts from the <profile>/chrome/JS/ directory (or the directory specified in chrome.manifest):
*.uc.js: Classic scripts. Synchronously injected into target documents.*.uc.mjs: ES6 modules (introduced in v0.8). Loaded into target documents asynchronously.*.sys.mjs: Module scripts. Loaded into the global context synchronously once on startup.
Script Injection Scopes
- Default Behavior: Scripts are executed at the
DOMContentLoadedevent of the top-level window. They do not automatically trigger for sub-documents (like iframes or sidebars). - Persistent DOM Injection: To inject scripts/styles into sub-documents, create a boolean preference
userChromeJS.persistent_domcontent_callbackand set it totrue. This is a global toggle. - Process Limitations: Scripts are only injected into parent-process documents. They will not run in separate processes like
about:newtab.
/* Example file names */
my_script.uc.js
my_module.uc.mjs
global_logic.sys.mjs