diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index 95dc6d3abaa7..b3010209fb25 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -139,7 +139,7 @@ toolbar[mode="icons"] > #reload-button[displaystop] { /* For results that are actions, their description text is shown instead of the URL - this needs to follow the locale's direction, unlike URLs. */ -richlistitem[type="action"]:-moz-locale-dir(rtl) > .ac-url-box { +richlistitem[type~="action"]:-moz-locale-dir(rtl) > .ac-url-box { direction: rtl; } diff --git a/browser/themes/gnomestripe/browser/browser.css b/browser/themes/gnomestripe/browser/browser.css index ef49855255e1..62edb97a584f 100644 --- a/browser/themes/gnomestripe/browser/browser.css +++ b/browser/themes/gnomestripe/browser/browser.css @@ -1080,7 +1080,7 @@ toolbar[iconsize="small"] #fullscreen-button { color: -moz-nativehyperlinktext; } -richlistitem[type="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { +richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { list-style-image: url("chrome://browser/skin/actionicon-tab.png"); } diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index 8297200751c9..0975bfaa419f 100644 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -872,7 +872,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark, font-size: 0.95em; } -richlistitem[type="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { +richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { list-style-image: url("chrome://browser/skin/actionicon-tab.png"); } diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css index 562b83bd7026..a7f0d0d8f9c6 100644 --- a/browser/themes/winstripe/browser/browser.css +++ b/browser/themes/winstripe/browser/browser.css @@ -1123,7 +1123,7 @@ toolbar:not([iconsize="small"])[mode="icons"] #forward-button:not([disabled="tru } %endif -richlistitem[type="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { +richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon { list-style-image: url("chrome://browser/skin/actionicon-tab.png"); } diff --git a/toolkit/components/places/src/nsPlacesAutoComplete.js b/toolkit/components/places/src/nsPlacesAutoComplete.js index cb754be911fb..93e9a1eedb3f 100644 --- a/toolkit/components/places/src/nsPlacesAutoComplete.js +++ b/toolkit/components/places/src/nsPlacesAutoComplete.js @@ -1002,10 +1002,10 @@ nsPlacesAutoComplete.prototype = { // If actions are enabled and the page is open, add only the switch-to-tab // result. Otherwise, add the normal result. - let [url, style] = this._enableActions && openPageCount > 0 ? - ["moz-action:switchtab," + escapedEntryURL, "action"] : - [escapedEntryURL, style]; - this._addToResults(entryId, url, title, entryFavicon, style); + let [url, action] = this._enableActions && openPageCount > 0 ? + ["moz-action:switchtab," + escapedEntryURL, "action "] : + [escapedEntryURL, ""]; + this._addToResults(entryId, url, title, entryFavicon, action + style); return true; }, diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index 9b0950f57309..ce1bc8c6f563 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -1412,6 +1412,23 @@ var setupUrl = true; + // If the type includes an action, set up the item appropriately. + var types = type.split(/\s+/); + var actionIndex = types.indexOf("action"); + if (actionIndex >= 0) { + let [,action, param] = url.match(/^moz-action:([^,]+),(.*)$/); + this.setAttribute("actiontype", action); + url = param; + let desc = "]]>&action.switchToTab.label;&action.switchToTab.label;