mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 838969 - prevent certain social features from working in private windows. r=gavin
This commit is contained in:
parent
996eb295d8
commit
80576bf40e
@ -8,6 +8,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SocialService", "resource://gre/modules/SocialService.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow"];
|
||||
|
||||
@ -40,7 +41,7 @@ this.MozSocialAPI = {
|
||||
function injectController(doc, topic, data) {
|
||||
try {
|
||||
let window = doc.defaultView;
|
||||
if (!window)
|
||||
if (!window || PrivateBrowsingUtils.isWindowPrivate(window))
|
||||
return;
|
||||
|
||||
// Do not attempt to load the API into about: error pages
|
||||
@ -229,7 +230,8 @@ function getChromeWindow(contentWin) {
|
||||
|
||||
function isWindowGoodForChats(win) {
|
||||
return win.SocialChatBar
|
||||
&& win.SocialChatBar.isAvailable;
|
||||
&& win.SocialChatBar.isAvailable
|
||||
&& !PrivateBrowsingUtils.isWindowPrivate(win);
|
||||
}
|
||||
|
||||
function findChromeWindowForChats(preferredWindow) {
|
||||
|
Loading…
Reference in New Issue
Block a user