mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 838969 - prevent certain social features from working in private windows. r=gavin
This commit is contained in:
parent
95a3d4ce2c
commit
8a1ec61d5b
@ -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