Open Bug 1331735 Opened 8 years ago Updated 2 years ago

Create an API on nsIWebNavigation that allows to pass arguments without changing the signature of the function

Categories

(Core :: DOM: Security, defect, P3)

defect

Tracking

()

People

(Reporter: ckerschb, Unassigned)

References

Details

(Whiteboard: [domsecurity-backlog1])

> As suggested within > https://bugzilla.mozilla.org/show_bug.cgi?id=1329032#c18 > we need a sane API for nsIWebNavigation that allows to pass various arguments without changing the signature of the function. For the longer-term fix, I think we should strongly consider a more JS-friendly API here (in a followup) so we don't have to keep adding arguments and deciding whether they're optional or not, etc. I was going to suggest we simply add a way to pass in an nsIDocShellLoadInfo, but then I realized that there's no reason to force JS consumers to create such a beast. A plausible scriptable API for this would look like this in xpidl: void thisAPINeedsASaneName(in AString aURI, [optiona] in jsval aOptions); plus a webidl dictionary definition that we use to pull things out of the aOptions object (throwing when a non-object is passed) and then create an nsIDocShellLoadInfo from on the C++ side. A consumer of the API will then do: webnav.thisAPINeedsASaneName(myURI, { triggeringPrincipal: whatever }); etc, only passing in the options they want non-default behavior for.
Depends on: 1329032
Priority: -- → P3
Whiteboard: [domsecurity-backlog1]
> throwing when a non-object is passed More precisely if what's passed is (!isObject() && !isNullOrUndefined()).
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.