Open Bug 1452678 Opened 2 years ago Updated 2 years ago

Use devtools/shared/link everywhere where we open links in a tab


(DevTools :: General, enhancement)

Not set


(Not tracked)


(Reporter: ochameau, Unassigned)


(Blocks 1 open bug)


Bug 1444301 just introduced an helper module to easily open a link:

Which can be used like this:
  const {openLink} = require("devtools/client/shared/link");
  openLink("", toolbox);

The dependency on toolbox object may be dropped per bug 1444301 comment 74.

Today, there is about 20 occurences where we manually call openUILink:
Summary: Use devtools/shared/link → Use devtools/shared/link everywhere where we open links in a tab
After Bug, 

they were all renamed to openWebLinkIn

(but sadly devtools/client/shared/link must have missed the migration patch)
See Also: → 1374741
And openTrustedLink as well.

Should we complexify the module to handle both? And to support the relatedToCurrent argument (which allows to open a new tab next to the current tab instead of as the last one)
Probably worth exposing both openWebLink and openTrustedLink versions, to match the underlying browser APIs.  The main benefit of this link module to me is centralizing the boilerplate to find these functions from a DevTools context.

(Could also add relatedToCurrent if we have a need for it.)
Depends on: 1453495
Looks like it broke already.
(Bug 1453423 is handling the immediate breakage here, hopefully landing soon.)
Severity: normal → enhancement
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.