diff --git a/toolkit/components/extensions/ext-contentScripts.js b/toolkit/components/extensions/ext-contentScripts.js index febaf44c94ce..717a60f51faa 100644 --- a/toolkit/components/extensions/ext-contentScripts.js +++ b/toolkit/components/extensions/ext-contentScripts.js @@ -68,7 +68,7 @@ class ContentScriptParent { exclude_globs: details.excludeGlobs, all_frames: details.allFrames, match_about_blank: details.matchAboutBlank, - run_at: details.runAt, + run_at: details.runAt || "document_idle", js: [], css: [], }; diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js index 42981202a2ac..118ba9416208 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js @@ -308,7 +308,6 @@ add_task(async function test_contentscripts_register_js() { js: [{code: `(${textScriptCodeIdle})()`}], runAt: "document_idle", }, - // Extension URLs. { matches: ["http://localhost/*/file_sample.html"], @@ -328,7 +327,7 @@ add_task(async function test_contentscripts_register_js() { { matches: ["http://localhost/*/file_sample.html"], js: [{file: "content_script.js"}], - runAt: "document_idle", + // "runAt" is not specified here to ensure that it defaults to document_idle when missing. }, ];