fix(places): Include appropriate params for opening links

This commit is contained in:
Ed Lee 2018-01-29 14:37:33 -08:00
Родитель 0355634ae3
Коммит f5ef606965
3 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -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(); },