"Open in New Tab" under Developer Toolbar\Network doesn't send POST parameter

VERIFIED FIXED in Firefox 61

Status

defect
P2
normal
VERIFIED FIXED
2 years ago
3 months ago

People

(Reporter: hacrot3000, Assigned: glowka.tom, Mentored)

Tracking

({dev-doc-complete})

58 Branch
Firefox 61

Firefox Tracking Flags

(firefox61 fixed, firefox65 verified, firefox66 verified)

Details

Attachments

(3 attachments)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20171010220102

Steps to reproduce:

1. Open developer toolbar
2. Click Network tab
3. Right click on a request in the list
4. Click on "Open in new tab".


Actual results:

It does not send any POST parameters


Expected results:

The page should open WITH whole POST parameters as same as original. This feature is as same as FireBug and it very helpful for debug ajax request.
Component: Untriaged → Developer Tools: Netmonitor
Honza, isn't that the same as bug 1220758?

Sebastian
Flags: needinfo?(odvarko)
Alternate STR (from bug 1220758)

1. Go to http://codebad.com/~hdon/firefox-bug.php
2. Open Developers Tools' Network tab.
3. Click "submit" button.
4. Open context menu (right click) the Network tab's representation of the enusing HTTP request.
5. Select "Open in New Tab."

Honza
Flags: needinfo?(odvarko)
Priority: P3 → P2
Mentor: odvarko
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
@Abhinav, do you want to take a look at this?

Some comments:

1) openRequestInTab is implemented in
netmonitor\src\utils\firefox\open-request-in-tab.js

2) It doesn't work the first time since `request.requestPostData` is not available.

3) It works second time (following STR from comment #2) since data has been fetched.

4) See netmonitor/src/widgets/RequestListContextMenu.js 
There is `copyPostData` method that uses `connector.requestData` to fetch "requestPostData"
before copying the value into the clipboard. Something similar should be done in `openRequestInTab`,
which is also in RequestListContextMenu.js file.

Honza
Flags: needinfo?(abhinav.koppula)
(Reporter)

Comment 4

a year ago
(In reply to Jan Honza Odvarko [:Honza] from comment #2)
> Alternate STR (from bug 1220758)
> 
> 1. Go to http://codebad.com/~hdon/firefox-bug.php
> 2. Open Developers Tools' Network tab.
> 3. Click "submit" button.
> 4. Open context menu (right click) the Network tab's representation of the
> enusing HTTP request.
> 5. Select "Open in New Tab."
> 
> Honza

It doesn't fix this issue, the POST parameter still missing.
After follow the step 5, my browser show the new tab but that page says: "Your HTTP request method was: GET. "

It does not only missed the post parameter but also changed method from POST to GET.
(Reporter)

Updated

a year ago
Has STR: yes → no

Comment 5

a year ago
Hi Honza,
Sure, I can take a look at this.
Flags: needinfo?(abhinav.koppula)
Assigned to you, thanks!
Honza
Assignee: nobody → abhinav.koppula
Status: NEW → ASSIGNED
(Reporter)

Comment 7

a year ago
(In reply to Abhinav Koppula from comment #5)
> Hi Honza,
> Sure, I can take a look at this.

Thanks

Updated

a year ago
Blocks: 1220758
Assignee: abhinav.koppula → nobody
Status: ASSIGNED → NEW
Assignee: nobody → glowka.tom
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 11

a year ago
mozreview-review
Comment on attachment 8963855 [details]
Bug 1407515 - more detailed test of Open in New Tab

https://reviewboard.mozilla.org/r/232720/#review238150


Code analysis found 2 defects in this patch:
 - 2 defects found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: devtools/client/netmonitor/test/browser_net_open_request_in_tab.js:88
(Diff revision 1)
> +    document.querySelector(".network-details-panel-toggle"));
> +    EventUtils.sendMouseEvent({ type: "click" },
> +      document.querySelector("#security-tab"));
> +    await waitUntil(() => document.querySelector(
> +      "#security-panel .security-info-value"));
> +    };

Error: Expected indentation of 2 spaces but found 4. [eslint: indent-legacy]

::: devtools/client/netmonitor/test/browser_net_open_request_in_tab.js:88
(Diff revision 1)
> +    document.querySelector(".network-details-panel-toggle"));
> +    EventUtils.sendMouseEvent({ type: "click" },
> +      document.querySelector("#security-tab"));
> +    await waitUntil(() => document.querySelector(
> +      "#security-panel .security-info-value"));
> +    };

Error: Unnecessary semicolon. [eslint: no-extra-semi]
Comment hidden (mozreview-request)
(Assignee)

Updated

a year ago
Attachment #8963853 - Flags: review?(odvarko)
Attachment #8963854 - Flags: review?(odvarko)
Attachment #8963855 - Flags: review?(odvarko)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment on attachment 8963853 [details]
Bug 1407515 - make sure post data is suplied to Open in New Tab

https://reviewboard.mozilla.org/r/232716/#review238448
Attachment #8963853 - Flags: review?(odvarko) → review+
Comment on attachment 8963854 [details]
Bug 1407515 - simplify Open in New Tab in launchpad

https://reviewboard.mozilla.org/r/232718/#review238450
Attachment #8963854 - Flags: review?(odvarko) → review+
Comment on attachment 8963855 [details]
Bug 1407515 - more detailed test of Open in New Tab

https://reviewboard.mozilla.org/r/232720/#review238452

Thanks for the patch!

Just couple of inline comments.

Honza

::: devtools/client/netmonitor/test/browser_net_open_request_in_tab.js:21
(Diff revision 4)
>    let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
> +  let newTab;
>  
>    store.dispatch(Actions.batchEnable(false));
>  
> -  // Execute requests.
> +  // Post data may be fetched for other componentes (eg. headers panel)

Typo: componentes -> components

::: devtools/client/netmonitor/test/browser_net_open_request_in_tab.js:23
(Diff revision 4)
>  
>    store.dispatch(Actions.batchEnable(false));
>  
> -  // Execute requests.
> -  await performRequests(monitor, tab, 1);
> +  // Post data may be fetched for other componentes (eg. headers panel)
> +  // and as a side-effect in those situation hide existing bug (Bug 1407515)
> +  await changeDefaultDetailsPanel;

Could you just change the default tab?

store.getState().ui.detailsPanelSelectedTab = "security" ?

::: devtools/client/netmonitor/test/browser_net_open_request_in_tab.js:23
(Diff revision 4)
>  
>    store.dispatch(Actions.batchEnable(false));
>  
> -  // Execute requests.
> -  await performRequests(monitor, tab, 1);
> +  // Post data may be fetched for other componentes (eg. headers panel)
> +  // and as a side-effect in those situation hide existing bug (Bug 1407515)
> +  await changeDefaultDetailsPanel;

That comment shouldn't took the bug 1407515 as a reason. The bug will be fixed one day and it become obsolete.

It should rather say something like:

Post data may be fetched by the Header panel, so set the Security panel as the new default.
Attachment #8963855 - Flags: review?(odvarko)
Comment hidden (mozreview-request)
Comment on attachment 8963855 [details]
Bug 1407515 - more detailed test of Open in New Tab

https://reviewboard.mozilla.org/r/232720/#review238838

Looks great, thanks for the patch!
(just one inline nit comment)

R+ assuming try is green

Honza

::: devtools/client/netmonitor/test/sjs_method-test-server.sjs:15
(Diff revision 5)
> +function handleRequest(request, response) {
> +  response.setStatusLine(request.httpVersion, 200, "Och Aye");
> +  response.setHeader("Content-Type", "text/plain; charset=utf-8", false);
> +
> +  var body = request.method + "\n" ;
> +  if (request.method == 'POST') {

nit: use quotes -> "POST"
Attachment #8963855 - Flags: review?(odvarko) → review+
Comment hidden (mozreview-request)
(Assignee)

Comment 21

a year ago
(In reply to Jan Honza Odvarko [:Honza] from comment #19)

> R+ assuming try is green

Yep, it is https://treeherder.mozilla.org/#/jobs?repo=try&revision=276fadc600eafa352f3065a36ca19d7f931f7a1a
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 22

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4213a293a540
make sure post data is suplied to Open in New Tab r=Honza
https://hg.mozilla.org/integration/autoland/rev/52216da191ea
simplify Open in New Tab in launchpad r=Honza
https://hg.mozilla.org/integration/autoland/rev/1debc4ccf15b
more detailed test of Open in New Tab r=Honza
Keywords: checkin-needed

Comment 23

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/4213a293a540
https://hg.mozilla.org/mozilla-central/rev/52216da191ea
https://hg.mozilla.org/mozilla-central/rev/1debc4ccf15b
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61

Comment 24

a year ago
it is fixed? 
when will the fix be included in nightly? 
still not working in 2018-04-12...
(Assignee)

Comment 25

a year ago
Hey, thanks for reporting, can you please describe steps to reproduce the bug?

I also tried to reproduce the bug using steps from comment #2 on nightly 2018-04-09 and 2018-04-12 and I did not manage to. Do the steps below reproduce the bug for you? 
> Alternate STR (from bug 1220758)
> 
> 1. Go to http://codebad.com/~hdon/firefox-bug.php
> 2. Open Developers Tools' Network tab.
> 3. Click "submit" button.
> 4. Open context menu (right click) the Network tab's representation of the
> enusing HTTP request.
> 5. Select "Open in New Tab."

Comment 26

a year ago
1. Go to http://xhrbug.fisdev.de
2. Open Developers Tools Console tab.
3. Open context menu (right click) on the XHR request
4. Select "Open in New Tab."
(Assignee)

Comment 27

a year ago
Thanks for that STR, but I am not able to reproduce it.  After selecting XHR request and clicking "Open in New Tab" I get "REQUEST_METHOD was POST". Again both nightly 2018-04-09 and 2018-04-12. 

Anyone can reproduce that?
(Assignee)

Comment 29

a year ago
Now I see that in the picture. Thanks for attaching it! Just after looking at your screen picture I realized I had overlooked point 2 from your comment #26 STR in which you mention "Developers Tools Console" tab.
So firstly I can reproduce it now and secondly I think you are in fact reporting new bug. This one was related to "Developers Tools Netmonitor" tab which also has "Open in New Tab" functionality, but is quite different piece of code.

Can you take STR from comment #26 and create the new bug for "Developers Tools Console" component?

Updated

10 months ago
Product: Firefox → DevTools
I added a note to the Fx61 rel notes:
https://developer.mozilla.org/en-US/Firefox/Releases/61#Developer_tools

I also updated a note in the network monitor page to mention this issue:
https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor#Open_in_New_Tab

Does this look Ok?

Comment 31

10 months ago
It doesn't work properly if content type of the request is "application/json".

In my test case, I sent "{"email":"email@example.com","password":"text&with&ampersand&in&it!"}" with "application/json" content type.

But when I open it in a new tab, it will send "application/x-www-form-urlencoded" content type which will be interpreted as:

{"email":"email@example.com","password":"text
with
ampersand
in
it!"}
@omid: please create a new report, this one is alrwady closed.
I'll investigate it,
Thanks!

Honza
Flags: needinfo?(omidmr)

Updated

8 months ago
Flags: needinfo?(omidmr)

I verified the fix on Ubuntu 16.04 x64, macOS 10.12, Windows 10 x64 and Windows 7 x64 using latest Nightly 66.0a1 and Dev Edition 66.0b2. The bug is not reproducing anymore.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.