Closed Bug 1360196 Opened 7 years ago Closed 7 years ago

Allow loading network monitor in a tab

Categories

(DevTools :: Netmonitor, enhancement)

enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

Like bug 1297758 for the inspector or bug 1307765 for the console, we can allow loading the network monitor in a tab by using the following url:
  chrome://devtools/content/netmonitor/index.html?type=tab&id=${Tab.Id}

It could help working on network monitor. Its code get refreshed from sources if you reload the tab. And it may help figuring out perf issue Ricky mentioned to me about Netmon being faster when run in a tab from launchpad.
Comment on attachment 8862512 [details]
Bug 1360196 - Implement about:devtools-toolbox URL parameter in the network monitor.

https://reviewboard.mozilla.org/r/134350/#review137562

Almost looks good to me! Thanks for helping me profiling netmonitor panel. This about:devtools-toolbox can also help us identify how other panels impact on perf when running on chrome process. There are a few nits please fix them. :)

::: devtools/client/netmonitor/index.html:54
(Diff revision 1)
>          destroy() {
>            unmountComponentAtNode(this.mount);
>            return NetMonitorController.shutdownNetMonitor();
>          }
>        };
> +

nit: 

I'd suggest commenting more details about this step to override Netmonitor.bootstrap is in order to support loading netmonitor panel via about:devtools-toolbox.

Futhermore, do we have MDN docs provides STR for opening devtools panel via about:devtools-toolbox? If there is, we can also comment the link here.

::: devtools/client/netmonitor/index.html:62
(Diff revision 1)
> +      let url = new window.URL(href);
> +
> +      // If query parameters are given in a chrome tab, the inspector is running in standalone.
> +      if (window.location.protocol === "chrome:" && url.search.length > 1) {
> +        const { targetFromURL } = require("devtools/client/framework/target-from-url");
> +        const {Task} = require("devtools/shared/task");

nit: netmonitor has converted all Task.js into async await or promise instead after refactoring.

I'd suggest using Promise here or it's fine if you prefer to use async await.
Attachment #8862512 - Flags: review?(rchien) → review+
(In reply to Ricky Chien [:rickychien] from comment #3)
> I'd suggest commenting more details about this step to override
> Netmonitor.bootstrap is in order to support loading netmonitor panel via
> about:devtools-toolbox.

Added a comment.

> Futhermore, do we have MDN docs provides STR for opening devtools panel via
> about:devtools-toolbox? If there is, we can also comment the link here.

No, the only online reference of that is bugzilla and this thread:
https://groups.google.com/forum/#!msg/mozilla.dev.developer-tools/kkWSvqxgkFg/4m_DiBNiBwAJ
For now, this feature is just for core contributors.
I never received feedback from anyone about this, so I'm hesitent to start communicating about it widely.

Note the existence of bug 1307860 which would significantly reduce the complexity of this...

> nit: netmonitor has converted all Task.js into async await or promise
> instead after refactoring.
> 
> I'd suggest using Promise here or it's fine if you prefer to use async await.

Switched to async/await.
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/44468104c31e
Implement about:devtools-toolbox URL parameter in the network monitor. r=rickychien
https://hg.mozilla.org/mozilla-central/rev/44468104c31e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: