summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-11-07 12:47:12 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-11-07 12:47:12 +0100
commit8240fb9c736f91044cabbdde8c537b179fc4921e (patch)
tree49a4cc8dc683cf955d61b6618ad471860554ccb5 /application/palemoon/components
parentf9e04b54c2ccbc1f8e24b511003de09b4565193c (diff)
parent5c83a18cde404b5c0c9fba1d35f003d951ea32e2 (diff)
downloadUXP-8240fb9c736f91044cabbdde8c537b179fc4921e.tar
UXP-8240fb9c736f91044cabbdde8c537b179fc4921e.tar.gz
UXP-8240fb9c736f91044cabbdde8c537b179fc4921e.tar.lz
UXP-8240fb9c736f91044cabbdde8c537b179fc4921e.tar.xz
UXP-8240fb9c736f91044cabbdde8c537b179fc4921e.zip
Merge branch 'master' into Pale_Moon-release
# Conflicts: # application/palemoon/config/version.txt
Diffstat (limited to 'application/palemoon/components')
-rw-r--r--application/palemoon/components/nsBrowserGlue.js15
-rw-r--r--application/palemoon/components/permissions/aboutPermissions.js8
-rw-r--r--application/palemoon/components/places/content/editBookmarkOverlay.js5
-rw-r--r--application/palemoon/components/preferences/advanced.js4
-rw-r--r--application/palemoon/components/preferences/security.xul19
-rw-r--r--application/palemoon/components/statusbar/Status.jsm20
-rw-r--r--application/palemoon/components/statusbar/Status4Evar.jsm45
-rw-r--r--application/palemoon/components/statusbar/content-thunk.js23
-rw-r--r--application/palemoon/components/statusbar/moz.build1
9 files changed, 118 insertions, 22 deletions
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js
index 720d1165c..f0a7aa22a 100644
--- a/application/palemoon/components/nsBrowserGlue.js
+++ b/application/palemoon/components/nsBrowserGlue.js
@@ -152,6 +152,9 @@ BrowserGlue.prototype = {
// nsIObserver implementation
observe: function BG_observe(subject, topic, data) {
switch (topic) {
+ case "notifications-open-settings":
+ this._openPermissions(subject);
+ break;
case "prefservice:after-app-defaults":
this._onAppDefaults();
break;
@@ -322,6 +325,7 @@ BrowserGlue.prototype = {
// initialization (called on application startup)
_init: function BG__init() {
let os = Services.obs;
+ os.addObserver(this, "notifications-open-settings", false);
os.addObserver(this, "prefservice:after-app-defaults", false);
os.addObserver(this, "final-ui-startup", false);
os.addObserver(this, "browser-delayed-startup-finished", false);
@@ -354,6 +358,7 @@ BrowserGlue.prototype = {
// cleanup (called on application shutdown)
_dispose: function BG__dispose() {
let os = Services.obs;
+ os.removeObserver(this, "notifications-open-settings");
os.removeObserver(this, "prefservice:after-app-defaults");
os.removeObserver(this, "final-ui-startup");
os.removeObserver(this, "sessionstore-windows-restored");
@@ -1484,6 +1489,16 @@ BrowserGlue.prototype = {
}
},
+ _openPermissions: function(aPrincipal) {
+ var win = this.getMostRecentBrowserWindow();
+ var url = "about:permissions";
+ try {
+ url = url + "?filter=" + aPrincipal.URI.host;
+ }
+ catch (e) {}
+ win.openUILinkIn(url, "tab");
+ },
+
_hasSystemAlertsService: function() {
try {
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
diff --git a/application/palemoon/components/permissions/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js
index 6a02daa29..421b65a0e 100644
--- a/application/palemoon/components/permissions/aboutPermissions.js
+++ b/application/palemoon/components/permissions/aboutPermissions.js
@@ -516,6 +516,14 @@ var AboutPermissions = {
Services.obs.notifyObservers(null, "browser-permissions-preinit", null);
this._initPart2();
+
+ // Process about:permissions?filter=<string>
+ // About URIs don't support query params, so do this manually
+ var loc = document.location.href;
+ var matches = /[?&]filter\=([^&]+)/i.exec(loc);
+ if (matches) {
+ this.sitesFilter.value = decodeURIComponent(matches[1]);
+ }
},
sitesReload: function() {
diff --git a/application/palemoon/components/places/content/editBookmarkOverlay.js b/application/palemoon/components/places/content/editBookmarkOverlay.js
index 69d7d32eb..e3d4537c7 100644
--- a/application/palemoon/components/places/content/editBookmarkOverlay.js
+++ b/application/palemoon/components/places/content/editBookmarkOverlay.js
@@ -222,6 +222,11 @@ var gEditItemOverlay = {
}
let focusElement = () => {
+ let elt = document.querySelector("textbox:not([collapsed=true])");
+ if (elt) {
+ elt.focus();
+ elt.select();
+ }
this._initialized = true;
};
diff --git a/application/palemoon/components/preferences/advanced.js b/application/palemoon/components/preferences/advanced.js
index 0803496fe..aab58b386 100644
--- a/application/palemoon/components/preferences/advanced.js
+++ b/application/palemoon/components/preferences/advanced.js
@@ -455,7 +455,7 @@ var gAdvancedPane = {
var list = document.getElementById("offlineAppsList");
var item = list.selectedItem;
var origin = item.getAttribute("origin");
- var principal = BrowserUtils.principalFromOrigin(origin);
+ var principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
@@ -474,7 +474,7 @@ var gAdvancedPane = {
// get the permission
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
.getService(Components.interfaces.nsIPermissionManager);
- var perm = pm.getPermissionObject(principal, "offline-app");
+ var perm = pm.getPermissionObject(principal, "offline-app", true);
if (perm) {
// clear offline cache entries
try {
diff --git a/application/palemoon/components/preferences/security.xul b/application/palemoon/components/preferences/security.xul
index d3d321b16..b12946f2a 100644
--- a/application/palemoon/components/preferences/security.xul
+++ b/application/palemoon/components/preferences/security.xul
@@ -50,6 +50,15 @@
name="security.cert_pinning.enforcement_level"
type="int"/>
+ <!-- Opportunistic Encryption -->
+
+ <preference id="network.http.upgrade-insecure-requests"
+ name="network.http.upgrade-insecure-requests"
+ type="bool"/>
+ <preference id="network.http.altsvc.oe"
+ name="network.http.altsvc.oe"
+ type="bool"/>
+
<!-- XSS Filter -->
<!--
<preference id="security.xssfilter.enable" name="security.xssfilter.enable" type="bool"/>
@@ -144,6 +153,16 @@
oncommand="gSecurityPane.updateHPKPPref();"/>
</vbox>
</groupbox>
+
+ <groupbox id="OpportunisticEncryption">
+ <caption label="&OpEnc.label;"/>
+ <checkbox id="enableUIROpEnc"
+ label="&enableUIROpEnc.label;"
+ preference="network.http.upgrade-insecure-requests" />
+ <checkbox id="enableAltSvcOpEnc"
+ label="&enableAltSvcOpEnc.label;"
+ preference="network.http.altsvc.oe" />
+ </groupbox>
<!-- XSS Filter -->
<!--
diff --git a/application/palemoon/components/statusbar/Status.jsm b/application/palemoon/components/statusbar/Status.jsm
index d888c7d94..19e12ddfd 100644
--- a/application/palemoon/components/statusbar/Status.jsm
+++ b/application/palemoon/components/statusbar/Status.jsm
@@ -35,7 +35,7 @@ S4EStatusService.prototype =
_defaultStatus: { val: "", type: "" },
_isFullScreen: false,
- _isFullScreenVideo: false,
+ _isVideo: false,
_statusText: { val: "", type: "" },
_noUpdate: false,
@@ -222,18 +222,10 @@ S4EStatusService.prototype =
}
},
- updateFullScreen: function()
+ setFullScreenState: function(isFullScreen, isVideo)
{
- this._isFullScreen = this._window.fullScreen;
- this._isFullScreenVideo = false;
- if(this._isFullScreen)
- {
- let fsEl = this._window.content.document.mozFullScreenElement;
- if(fsEl && (fsEl.nodeName == "VIDEO" || fsEl.getElementsByTagName("VIDEO").length > 0))
- {
- this._isFullScreenVideo = true;
- }
- }
+ this._isFullScreen = isFullScreen;
+ this._isVideo = isFullScreen && isVideo;
this.clearStatusField();
this.updateStatusField(true);
@@ -305,7 +297,7 @@ S4EStatusService.prototype =
let label = null;
- if(this._isFullScreen && this._service.advancedStatusDetectFullScreen)
+ if(this._isFullScreen)
{
switch(location)
{
@@ -330,7 +322,7 @@ S4EStatusService.prototype =
break;
case 3: // Popup
default:
- if(this._isFullScreenVideo && this._service.advancedStatusDetectVideo)
+ if(this._isVideo)
{
return;
}
diff --git a/application/palemoon/components/statusbar/Status4Evar.jsm b/application/palemoon/components/statusbar/Status4Evar.jsm
index 055306a88..6400f2e2a 100644
--- a/application/palemoon/components/statusbar/Status4Evar.jsm
+++ b/application/palemoon/components/statusbar/Status4Evar.jsm
@@ -31,7 +31,7 @@ function Status4Evar(window, gBrowser, toolbox)
this.statusService = new S4EStatusService(this._window, s4e_service, this.getters);
this.progressMeter = new S4EProgressService(gBrowser, s4e_service, this.getters, this.statusService);
this.downloadStatus = new S4EDownloadService(this._window, gBrowser, s4e_service, this.getters);
- this.sizeModeService = new SizeModeService(this._window, this);
+ this.sizeModeService = new SizeModeService(this._window, gBrowser, this);
this._window.addEventListener("unload", this, false);
}
@@ -232,20 +232,31 @@ S4EWindowGetters.prototype =
}
};
-function SizeModeService(window, s4e)
+function SizeModeService(window, gBrowser, s4e)
{
this._window = window;
+ this._gBrowser = gBrowser;
this._s4e = s4e;
+ this._mm = this._window.messageManager;
this.lastFullScreen = this._window.fullScreen;
this.lastwindowState = this._window.windowState;
+
+ if(s4e_service.advancedStatusDetectFullScreen)
+ {
+ this._mm.addMessageListener("status4evar@caligonstudios.com:video-detect-answer", this)
+ this._mm.loadFrameScript("resource:///modules/statusbar/content-thunk.js", true);
+ }
+
this._window.addEventListener("sizemodechange", this, false);
}
SizeModeService.prototype =
{
_window: null,
+ _gBrowser: null,
_s4e: null,
+ _mm: null,
lastFullScreen: null,
lastwindowState: null,
@@ -254,7 +265,13 @@ SizeModeService.prototype =
{
this._window.removeEventListener("sizemodechange", this, false);
- ["_window", "_s4e"].forEach(function(prop)
+ if(s4e_service.advancedStatusDetectFullScreen)
+ {
+ this._mm.removeDelayedFrameScript("resource:///modules/statusbar/content-thunk.js");
+ this._mm.removeMessageListener("status4evar@caligonstudios.com:video-detect-answer", this);
+ }
+
+ ["_window", "_gBrowser", "_s4e", "_mm"].forEach(function(prop)
{
delete this[prop];
}, this);
@@ -262,10 +279,18 @@ SizeModeService.prototype =
handleEvent: function(e)
{
- if(this._window.fullScreen != this.lastFullScreen)
+ if(this._window.fullScreen != this.lastFullScreen && s4e_service.advancedStatusDetectFullScreen)
{
this.lastFullScreen = this._window.fullScreen;
- this._s4e.statusService.updateFullScreen();
+
+ if(this.lastFullScreen && s4e_service.advancedStatusDetectVideo)
+ {
+ this._gBrowser.selectedBrowser.messageManager.sendAsyncMessage("status4evar@caligonstudios.com:video-detect");
+ }
+ else
+ {
+ this._s4e.statusService.setFullScreenState(this.lastFullScreen, false);
+ }
}
if(this._window.windowState != this.lastwindowState)
@@ -275,5 +300,13 @@ SizeModeService.prototype =
}
},
- QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener ])
+ receiveMessage: function(message)
+ {
+ if(message.name == "status4evar@caligonstudios.com:video-detect-answer")
+ {
+ this._s4e.statusService.setFullScreenState(this.lastFullScreen, message.data.isVideo);
+ }
+ },
+
+ QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener, CI.nsIMessageListener ])
};
diff --git a/application/palemoon/components/statusbar/content-thunk.js b/application/palemoon/components/statusbar/content-thunk.js
new file mode 100644
index 000000000..fe1fbabad
--- /dev/null
+++ b/application/palemoon/components/statusbar/content-thunk.js
@@ -0,0 +1,23 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function handleVideoDetect(message)
+{
+ let isVideo = false;
+
+ let fsEl = content.document.mozFullScreenElement;
+ if(fsEl)
+ {
+ isVideo = (
+ fsEl.nodeName == "VIDEO"
+ || (fsEl.nodeName == "IFRAME" && fsEl.contentDocument && fsEl.contentDocument.getElementsByTagName("VIDEO").length > 0)
+ || fsEl.getElementsByTagName("VIDEO").length > 0
+ );
+ }
+
+ sendAsyncMessage("status4evar@caligonstudios.com:video-detect-answer", {isVideo: isVideo});
+}
+
+addMessageListener("status4evar@caligonstudios.com:video-detect", handleVideoDetect);
+
diff --git a/application/palemoon/components/statusbar/moz.build b/application/palemoon/components/statusbar/moz.build
index ba8cfef86..0f7f597a5 100644
--- a/application/palemoon/components/statusbar/moz.build
+++ b/application/palemoon/components/statusbar/moz.build
@@ -16,6 +16,7 @@ EXTRA_COMPONENTS += [
]
EXTRA_JS_MODULES.statusbar = [
+ 'content-thunk.js',
'Downloads.jsm',
'Progress.jsm',
'Status.jsm',