Pass isInContentPage prop to reps

RESOLVED FIXED in Firefox 68


2 months ago
a month ago


(Reporter: nchevobbe, Assigned: nchevobbe)


66 Branch
Firefox 68
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)



(1 attachment)



2 months ago

In, we added back the href attribute on string links so they can behave as regular link.

In order to do that in a secure way, we only add the href attribute if either the openLink or the isInContentPage prop is passed.

For the JSON Viewer, since we're displaying it in the content page, we need to pass the isInContentPage, and remove any openLink we may have, in order for the links to be handled by the browser directly.

Priority: -- → P3

Comment 1

2 months ago

This will allow links to be handled by the browser, so we
don't have to have our own logic for that.
The reps bundle was updated to reflect the changes made
in Reps files.

Depends on D26710


Comment 2

a month ago

Hello Christoph,
I see a some tab crashes in debug mode with the patch for this bug applied (

Steps to reproduce

  1. Apply the patch
  2. Navigate to data:application/json,["visit%20"]
  3. It should open the JSON Viewer, with a link, click on it

Expected results

The link is opened in a new tab

Actual results

A new tab is created but crashes.
It looks like we are failing the assertion from docshell/base/nsDocShell.cpp#9923-9926, that I think you added not long ago.

Would you have any idea why? Thanks!

Flags: needinfo?(ckerschb)

Comment 3

a month ago

(Updated previous comment that was sent to soon)


Comment 4

a month ago

The patch does nothing too fancy IMO. We add an actual href attribute to the links we produce, and remove the click handler we had before to open said links.

Hey Nicholas, sorry for the late reply. Do you happen to have a JS stacktrace?

If the assertion |MOZ_ASSERT(nsCSPContext::Equals(csp, argsCSP));| within nsDochsell fires that this indicates that we are not explicitly passing a CSP from JS-land into docshell loads. We added this assertion as pre-requisite because we would like to move the CSP off the Principal and hence we need to ensure wherever we pass a Principal we explicitly pass a Principal alongside with it.

The assertion is nothing to worry for now, because in release code we still use the CSP from the Principal (at least until bug 965637 is fixed). Nevertheless I would like to have it fixed. So if you happen to have a stacktrace I could provide clear guidance on how to fix the problem.


Flags: needinfo?(ckerschb) → needinfo?(nchevobbe)

Comment 6

a month ago

Not sure what you mean by JS stacktrace, as it happens on a link click?

I've recorded the interaction leading to the crash in , hope it helps!

Flags: needinfo?(nchevobbe)

FWIW, I can reproduce the problem and I filed Bug 1544534. Thanks for bringing the problem to my attention - I'll take care of it ASAP.

Nicolas, please add back the checks in browser_jsonview_url_linkification.js that ensured links are real and not fake.
You removed them in

Blocks: 1447820

Comment 9

a month ago

(In reply to Oriol Brufau [:Oriol] from comment #8)

Nicolas, please add back the checks in browser_jsonview_url_linkification.js that ensured links are real and not fake.
You removed them in

Sure, I added the assertion back in the test.
New push to TRY since Bug 1544534 landed.

Comment 10

a month ago
Pushed by
Remove openLink and pass isInContentPage to Rep. r=Honza.

Comment 11

a month ago
Last Resolved: a month ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.