Closed Bug 1847222 Opened 1 year ago Closed 1 year ago

Always define bindings if disableBreaks is true

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

As discovered in bug 1842701 comment #26, some devtools internal methods relies on the extra bindings, such as copy or $0, but those bindings are not defined if there's conflicting global, which results in breaking the feature.

Those internal methods use options.disableBreaks, and that can be used as condition to always define bindings even if there's conflicting bindings.

https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/devtools/client/webconsole/actions/object.js#50-53

const res = await commands.scriptCommand.execute("copy(_self)", {
  selectedObjectActor: actor,
  disableBreaks: true,
});

https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/devtools/client/inspector/markup/markup-context-menu.js#364-370,372-375

const evalString = `{ let i = 0;
  while (window.hasOwnProperty("temp" + i) && i < 1000) {
    i++;
  }
  window["temp" + i] = $0;
  "temp" + i;
}`;
...
const res = await this.toolbox.commands.scriptCommand.execute(evalString, {
  selectedNodeActor: this.selection.nodeFront.actorID,
  disableBreaks: true,
});

Most commands should be migrated to stop using evaluation, which is tracked in another bug

Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P3

(In reply to Julian Descottes [:jdescottes] from comment #1)

Most commands should be migrated to stop using evaluation, which is tracked in another bug

Yes, that's Bug 1847219

Flags: needinfo?(nchevobbe)
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/5829fb3eba55 Always define bindings if options.disableBreaks is true. r=nchevobbe,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: