Closed Bug 1501206 Opened 2 years ago Closed 2 years ago

Introduce a new function ReferrerPolicyToString()

Categories

(Core :: Networking, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: Honza, Assigned: tnguyen)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

This is a follow up for bug 1496742

The Network monitor (in Firefox DevTools) should display the referrer policy applied to a request. This feature requires a new (platform) API allowing to get string representation of referrer policy value.

See also bug 1496742 comment #14

It would be great to have: ReferrerPolicyToString() function 

Should be placed here:
https://searchfox.org/mozilla-central/source/netwerk/base/ReferrerPolicy.h

Honza
Duplicate of this bug: 1501199
Assignee: nobody → tnguyen
Ah, you were faster ;-)

Honza
Priority: -- → P3
Whiteboard: [necko-triaged]
We may need this function to convert ReferrerPolicy enum to string then
we can display referrer policy applied to a request.

MozReview-Commit-ID: B3xPAiykcOV
Pushed by tnguyen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/219cc9ec62c8
Introduce a new function ReferrerPolicyToString() r=ckerschb
Hi Thomas

Thanks for the patch. Just to clarify, I am currently accessing the referrerPolicy value using this value:
https://searchfox.org/mozilla-central/source/netwerk/protocol/http/nsIHttpChannel.idl#94

Do I need to access a different API now? If we are still using the same value, I'll wait for the patch to land in the codebase, pull the changes and then verify the results :) Thank you!
Flags: needinfo?(tnguyen)
https://hg.mozilla.org/mozilla-central/rev/219cc9ec62c8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Oh, sorry, I just created a function in C++, I did not realize your patch is changing js. Probably need to expose this function from JS (through idl in devtool) or create a separated same function in devtool js.
Flags: needinfo?(tnguyen)
Hi Thomas

Thanks for the clarification :) May I ask how can I expose this function in `nsIHttpChannel.idl`?
Flags: needinfo?(tnguyen)
(In reply to Thomas Nguyen from comment #9)
> Oh, sorry, I just created a function in C++, I did not realize your patch is
> changing js. Probably need to expose this function from JS (through idl in
> devtool) or create a separated same function in devtool js.

Should we file a new bug that exposes the new `ReferrerPolicyToString` function to JavaScript (DevTools)?

Honza
If that is only used in devtool(for bug 1496742). I don't think we need to create another one, I think you should write a function in that bug.
Flags: needinfo?(tnguyen)
(In reply to Thomas Nguyen from comment #12)
> If that is only used in devtool(for bug 1496742). I don't think we need to
> create another one, I think you should write a function in that bug.
Works for me. Any tips about how the function should be exposed?

Honza
Flags: needinfo?(tnguyen)
I think I could do it for you, continuing this bug.
Status: RESOLVED → REOPENED
Flags: needinfo?(tnguyen)
Resolution: FIXED → ---
MozReview-Commit-ID: 2bbk0LkwcXG
That was a bug, I got reviewed by Valentin but using Lando the "r=valentin" was missing. Or probably I did wrong step.
https://hg.mozilla.org/mozilla-central/rev/6c184e0d86d7
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.