fix(places): Include appropriate params for opening links
This commit is contained in:
Родитель
0355634ae3
Коммит
f5ef606965
|
@ -247,7 +247,10 @@ class PlacesFeed {
|
|||
* Open a link in a desired destination defaulting to action's event.
|
||||
*/
|
||||
openLink(action, where = "", isPrivate = false) {
|
||||
const params = {private: isPrivate};
|
||||
const params = {
|
||||
private: isPrivate,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})
|
||||
};
|
||||
|
||||
// Always include the referrer (even for http links) if we have one
|
||||
const {event, referrer} = action.data;
|
||||
|
|
|
@ -166,6 +166,7 @@ describe("PlacesFeed", () => {
|
|||
assert.equal(url, "foo.com");
|
||||
assert.equal(where, "current");
|
||||
assert.propertyVal(params, "private", false);
|
||||
assert.propertyVal(params, "triggeringPrincipal", undefined);
|
||||
});
|
||||
it("should open link with referrer on OPEN_LINK", () => {
|
||||
const openLinkIn = sinon.stub();
|
||||
|
|
|
@ -90,7 +90,10 @@ overrider.set({
|
|||
getVisibleEngines: () => [{identifier: "google"}, {identifier: "bing"}],
|
||||
defaultEngine: {identifier: "google"}
|
||||
},
|
||||
scriptSecurityManager: {getSystemPrincipal() {}}
|
||||
scriptSecurityManager: {
|
||||
createNullPrincipal() {},
|
||||
getSystemPrincipal() {}
|
||||
}
|
||||
},
|
||||
XPCOMUtils: {
|
||||
defineLazyGetter(_1, _2, f) { f(); },
|
||||
|
|
Загрузка…
Ссылка в новой задаче