diff --git a/browser/app/permissions b/browser/app/permissions
index 9c421e8510e0..bc3cddbbf436 100644
--- a/browser/app/permissions
+++ b/browser/app/permissions
@@ -8,6 +8,7 @@
# UITour
host uitour 1 www.mozilla.org
+host uitour 1 self-repair.mozilla.org
host uitour 1 support.mozilla.org
host uitour 1 about:home
diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js
index 74e452245779..4ebfe977f434 100644
--- a/browser/base/content/abouthome/aboutHome.js
+++ b/browser/base/content/abouthome/aboutHome.js
@@ -307,10 +307,11 @@ function onSearchSubmit(aEvent)
if (engineName && searchTerms.length > 0) {
// Send an event that will perform a search and Firefox Health Report will
// record that a search from about:home has occurred.
-
+ let useNewTab = aEvent && aEvent.button == 1;
let eventData = {
engineName: engineName,
- searchTerms: searchTerms
+ searchTerms: searchTerms,
+ useNewTab: useNewTab,
};
if (searchText.hasAttribute("selection-index")) {
diff --git a/browser/base/content/content.js b/browser/base/content/content.js
index 107694f7cd00..d1e490fc4fac 100644
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -1064,3 +1064,38 @@ addMessageListener("ContextMenu:SaveVideoFrameAsImage", (message) => {
dataURL: canvas.toDataURL("image/jpeg", ""),
});
});
+
+addMessageListener("ContextMenu:MediaCommand", (message) => {
+ let media = message.objects.element;
+
+ switch (message.data.command) {
+ case "play":
+ media.play();
+ break;
+ case "pause":
+ media.pause();
+ break;
+ case "mute":
+ media.muted = true;
+ break;
+ case "unmute":
+ media.muted = false;
+ break;
+ case "playbackRate":
+ media.playbackRate = message.data.data;
+ break;
+ case "hidecontrols":
+ media.removeAttribute("controls");
+ break;
+ case "showcontrols":
+ media.setAttribute("controls", "true");
+ break;
+ case "hidestats":
+ case "showstats":
+ let event = media.ownerDocument.createEvent("CustomEvent");
+ event.initCustomEvent("media-showStatistics", false, true,
+ message.data.command == "showstats");
+ media.dispatchEvent(event);
+ break;
+ }
+});
diff --git a/browser/base/content/newtab/search.js b/browser/base/content/newtab/search.js
index b868aef2c0db..63d769108fb6 100644
--- a/browser/base/content/newtab/search.js
+++ b/browser/base/content/newtab/search.js
@@ -49,11 +49,12 @@ let gSearch = {
let searchText = this._nodes.text;
let searchStr = searchText.value;
if (this.currentEngineName && searchStr.length) {
-
+ let useNewTab = event && event.button == 1;
let eventData = {
engineName: this.currentEngineName,
searchString: searchStr,
whence: "newtab",
+ useNewTab: useNewTab,
}
if (searchText.hasAttribute("selection-index")) {
@@ -244,7 +245,7 @@ let gSearch = {
let parent = document.getElementById("newtab-scrollbox");
this._suggestionController =
new SearchSuggestionUIController(this._nodes.text, parent,
- () => this.search());
+ event => this.search(event));
}
this._suggestionController.engineName = engine.name;
},
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
index 84465d5ad8d5..abb368990785 100644
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1668,37 +1668,10 @@ nsContextMenu.prototype = {
},
mediaCommand : function CM_mediaCommand(command, data) {
- var media = this.target;
-
- switch (command) {
- case "play":
- media.play();
- break;
- case "pause":
- media.pause();
- break;
- case "mute":
- media.muted = true;
- break;
- case "unmute":
- media.muted = false;
- break;
- case "playbackRate":
- media.playbackRate = data;
- break;
- case "hidecontrols":
- media.removeAttribute("controls");
- break;
- case "showcontrols":
- media.setAttribute("controls", "true");
- break;
- case "hidestats":
- case "showstats":
- var event = media.ownerDocument.createEvent("CustomEvent");
- event.initCustomEvent("media-showStatistics", false, true, command == "showstats");
- media.dispatchEvent(event);
- break;
- }
+ let mm = this.browser.messageManager;
+ mm.sendAsyncMessage("ContextMenu:MediaCommand",
+ {command: command, data: data},
+ {element: this.target});
},
copyMediaLocation : function () {
diff --git a/browser/base/content/searchSuggestionUI.js b/browser/base/content/searchSuggestionUI.js
index ba49b23102b4..2690536d8c2c 100644
--- a/browser/base/content/searchSuggestionUI.js
+++ b/browser/base/content/searchSuggestionUI.js
@@ -32,7 +32,8 @@ const HTML_NS = "http://www.w3.org/1999/xhtml";
* @param onClick
* A function that's called when a search suggestion is clicked. Ideally
* we could call submit() on inputElement's ancestor form, but that
- * doesn't trigger submit listeners.
+ * doesn't trigger submit listeners. The function is passed one argument,
+ * the click event.
* @param idPrefix
* The IDs of elements created by the object will be prefixed with this
* string.
@@ -234,6 +235,9 @@ SearchSuggestionUIController.prototype = {
},
_onMousedown: function (event) {
+ if (event.button == 2) {
+ return;
+ }
let idx = this._indexOfTableRowOrDescendent(event.target);
let suggestion = this.suggestionAtIndex(idx);
this._stickyInputValue = suggestion;
@@ -251,7 +255,7 @@ SearchSuggestionUIController.prototype = {
this.input.setAttribute("selection-kind", "mouse");
this._hideSuggestions();
if (this.onClick) {
- this.onClick.call(null);
+ this.onClick.call(null, event);
}
},
diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml
index e42352b479d9..4176e92c6155 100644
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -984,7 +984,7 @@
-