commit 5b8cecce0d4bd21bdc9fea736fa6ae717de95fb5
parent ade2b4d57bc4748d9854614c6cd7f8af5e061fa2
Author: Nicolas Chevobbe <nchevobbe@mozilla.com>
Date: Wed, 12 Nov 2025 07:11:07 +0000
Bug 1995674 - [devtools] Fix opening source with external editor from the browser console. r=devtools-reviewers,bomsy.
Handle optional browser arg in `openInExternalEditor`.
Differential Revision: https://phabricator.services.mozilla.com/D271404
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/toolkit/components/viewsource/content/viewSourceUtils.js b/toolkit/components/viewsource/content/viewSourceUtils.js
@@ -271,7 +271,7 @@ var gViewSourceUtils = {
let ssm = Services.scriptSecurityManager;
let principal = ssm.createContentPrincipal(
data.uri,
- browser.contentPrincipal.originAttributes
+ browser ? browser.contentPrincipal.originAttributes : {}
);
webBrowserPersist.saveURI(
uri,