Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit da0d07c

Browse files
authored
Merge pull request #26 from firefox-devtools/correspond-to-backward-compatibility
Correspnd to backward compatibility (target to currentTarget)
2 parents 0d48308 + 88fe9a3 commit da0d07c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • extension/experiments/inspectedNode

extension/experiments/inspectedNode/api.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ this.inspectedNode = class extends ExtensionAPI {
1818
client.onNodeChange = onNodeChange;
1919

2020
const { inspector } = client;
21-
const changesFront = await inspector.currentTarget.getFront("changes");
21+
const target = inspector.currentTarget || inspector.target;
22+
const changesFront = await target.getFront("changes");
2223
// We call `allChanges()` to activate emiting all events from the actor now.
2324
// When the Bug 1563757 fixes, we can remove.
2425
// https://bugzilla.mozilla.org/show_bug.cgi?id=1563757
@@ -35,7 +36,8 @@ this.inspectedNode = class extends ExtensionAPI {
3536
// invalidated before dependencies have a chance to unregister. This guard is here
3637
// to prevent throwing errors as a result of trying to work on an unavailable front.
3738
try {
38-
const changesFront = await inspector.currentTarget.getFront("changes");
39+
const target = inspector.currentTarget || inspector.target;
40+
const changesFront = await target.getFront("changes");
3941
changesFront.off("clear-changes", onNodeChange);
4042
changesFront.off("remove-change", onNodeChange);
4143
changesFront.off("add-change", onNodeChange);

0 commit comments

Comments
 (0)