summaryrefslogtreecommitdiffstats
path: root/application/palemoon/modules
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/modules')
-rw-r--r--application/palemoon/modules/AboutHomeUtils.jsm2
-rw-r--r--application/palemoon/modules/QuotaManager.jsm14
-rw-r--r--application/palemoon/modules/WindowsPreviewPerTab.jsm64
-rw-r--r--application/palemoon/modules/moz.build11
4 files changed, 59 insertions, 32 deletions
diff --git a/application/palemoon/modules/AboutHomeUtils.jsm b/application/palemoon/modules/AboutHomeUtils.jsm
index 1d4070eaf..72712e1f3 100644
--- a/application/palemoon/modules/AboutHomeUtils.jsm
+++ b/application/palemoon/modules/AboutHomeUtils.jsm
@@ -44,7 +44,7 @@ this.AboutHomeUtils = {
return !Services.prefs.getBoolPref("browser.EULA.override");
} catch (e) { }
-#ifndef MOZILLA_OFFICIAL
+#ifndef MC_OFFICIAL
// Non-official builds shouldn't show the notification.
return false;
#endif
diff --git a/application/palemoon/modules/QuotaManager.jsm b/application/palemoon/modules/QuotaManager.jsm
index e03161a69..48cfe88b3 100644
--- a/application/palemoon/modules/QuotaManager.jsm
+++ b/application/palemoon/modules/QuotaManager.jsm
@@ -6,8 +6,9 @@ this.EXPORTED_SYMBOLS = ["QuotaManagerHelper"];
Components.utils.import('resource://gre/modules/Services.jsm');
-const Cc = Components.classes;
const Ci = Components.interfaces;
+const Cc = Components.classes;
+const Cu = Components.utils;
this.QuotaManagerHelper = {
clear: function(isShutDown) {
@@ -34,12 +35,17 @@ this.QuotaManagerHelper = {
}
}
}
- var qm = Cc["@mozilla.org/dom/quota/manager;1"].getService(Ci.nsIQuotaManager);
+ var qm = Cc["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(Ci.nsIQuotaManagerService);
for (var dom in doms) {
var uri = Services.io.newURI(dom, null, null);
- qm.clearStoragesForURI(uri);
+ let principal = Services.scriptSecurityManager
+ .createCodebasePrincipal(uri, {});
+ qm.clearStoragesForPrincipal(principal);
}
}
- } catch(er) {}
+ } catch(er) {
+ Cu.reportError(er);
+ }
}
};
diff --git a/application/palemoon/modules/WindowsPreviewPerTab.jsm b/application/palemoon/modules/WindowsPreviewPerTab.jsm
index 41b38f0cf..c1ed05c39 100644
--- a/application/palemoon/modules/WindowsPreviewPerTab.jsm
+++ b/application/palemoon/modules/WindowsPreviewPerTab.jsm
@@ -62,9 +62,6 @@ const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
////////////////////////////////////////////////////////////////////////////////
//// Various utility properties
-XPCOMUtils.defineLazyServiceGetter(this, "ioSvc",
- "@mozilla.org/network/io-service;1",
- "nsIIOService");
XPCOMUtils.defineLazyServiceGetter(this, "imgTools",
"@mozilla.org/image/tools;1",
"imgITools");
@@ -73,8 +70,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "faviconSvc",
"nsIFaviconService");
// nsIURI -> imgIContainer
-function _imageFromURI(uri, privateMode, callback) {
- let channel = ioSvc.newChannelFromURI(uri);
+function _imageFromURI(doc, uri, privateMode, callback) {
+ let channel = NetUtil.newChannel({
+ uri: uri,
+ loadUsingSystemPrincipal: true,
+ contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
+ });
+
try {
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
channel.setPrivate(privateMode);
@@ -93,17 +95,17 @@ function _imageFromURI(uri, privateMode, callback) {
// favicon).
let defaultURI = faviconSvc.defaultFavicon;
if (!defaultURI.equals(uri))
- _imageFromURI(defaultURI, callback);
+ _imageFromURI(doc, defaultURI, privateMode, callback);
}
});
}
// string? -> imgIContainer
-function getFaviconAsImage(iconurl, privateMode, callback) {
+function getFaviconAsImage(doc, iconurl, privateMode, callback) {
if (iconurl)
- _imageFromURI(NetUtil.newURI(iconurl), privateMode, callback);
+ _imageFromURI(doc, NetUtil.newURI(iconurl), privateMode, callback);
else
- _imageFromURI(faviconSvc.defaultFavicon, privateMode, callback);
+ _imageFromURI(doc, faviconSvc.defaultFavicon, privateMode, callback);
}
// Snaps the given rectangle to be pixel-aligned at the given scale
@@ -460,12 +462,16 @@ TabWindow.prototype = {
preview.visible = AeroPeek.enabled;
preview.active = this.tabbrowser.selectedTab == controller.tab;
// Grab the default favicon
- getFaviconAsImage(null, PrivateBrowsingUtils.isWindowPrivate(this.win), function (img) {
- // It is possible that we've already gotten the real favicon, so make sure
- // we have not set one before setting this default one.
- if (!preview.icon)
- preview.icon = img;
- });
+ getFaviconAsImage(
+ controller.linkedBrowser.contentWindow.document,
+ null,
+ PrivateBrowsingUtils.isWindowPrivate(this.win),
+ function (img) {
+ // It is possible that we've already gotten the real favicon, so make sure
+ // we have not set one before setting this default one.
+ if (!preview.icon)
+ preview.icon = img;
+ });
return preview;
},
@@ -510,7 +516,14 @@ TabWindow.prototype = {
// Previews are internally stored using a map, so we need to iterate over
// the tabbrowser's array of tabs to retrieve previews in the same order.
- let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))];
+ // Tycho: let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))];
+ let inorder = [];
+
+ for (let t of tabs) {
+ if (previews.has(t)) {
+ inorder.push(previews.get(t));
+ }
+ }
// Since the internal taskbar array has not yet been updated, we must force
// the sorting order of our local array on it. To do so, we must walk
@@ -545,14 +558,17 @@ TabWindow.prototype = {
//// Browser progress listener
onLinkIconAvailable: function (aBrowser, aIconURL) {
let self = this;
- getFaviconAsImage(aIconURL, PrivateBrowsingUtils.isWindowPrivate(this.win), function (img) {
- let index = self.tabbrowser.browsers.indexOf(aBrowser);
- // Only add it if we've found the index. The tab could have closed!
- if (index != -1) {
- let tab = self.tabbrowser.tabs[index];
- self.previews.get(tab).icon = img;
- }
- });
+ getFaviconAsImage(
+ aBrowser.contentWindow.document,
+ aIconURL,PrivateBrowsingUtils.isWindowPrivate(this.win),
+ function (img) {
+ let index = self.tabbrowser.browsers.indexOf(aBrowser);
+ // Only add it if we've found the index. The tab could have closed!
+ if (index != -1) {
+ let tab = self.tabbrowser.tabs[index];
+ self.previews.get(tab).icon = img;
+ }
+ });
}
}
diff --git a/application/palemoon/modules/moz.build b/application/palemoon/modules/moz.build
index b3459bcd5..f7717ef89 100644
--- a/application/palemoon/modules/moz.build
+++ b/application/palemoon/modules/moz.build
@@ -19,10 +19,12 @@ EXTRA_JS_MODULES += [
'PageMenu.jsm',
'PopupNotifications.jsm',
'QuotaManager.jsm',
- 'SharedFrame.jsm',
- 'webrtcUI.jsm'
+ 'SharedFrame.jsm'
]
+if CONFIG['MOZ_WEBRTC']:
+ EXTRA_JS_MODULES += ['webrtcUI.jsm']
+
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
EXTRA_JS_MODULES += [
'Windows8WindowFrameColor.jsm',
@@ -35,5 +37,8 @@ EXTRA_PP_JS_MODULES += [
'RecentWindow.jsm',
]
+# Pass down 'official build' flags
+if CONFIG['MC_OFFICIAL']:
+ DEFINES['MC_OFFICIAL'] = 1
if CONFIG['MOZILLA_OFFICIAL']:
- DEFINES['MOZILLA_OFFICIAL'] = 1 \ No newline at end of file
+ DEFINES['MOZILLA_OFFICIAL'] = 1