diff --git a/b2g/app/Makefile.in b/b2g/app/Makefile.in
index c7b26e6a55a6..c565c0654536 100644
--- a/b2g/app/Makefile.in
+++ b/b2g/app/Makefile.in
@@ -11,6 +11,10 @@ include $(DEPTH)/config/autoconf.mk
PREF_JS_EXPORTS = $(srcdir)/b2g.js
+ifdef ENABLE_MARIONETTE
+DEFINES += -DENABLE_MARIONETTE=1
+endif
+
ifndef LIBXUL_SDK
PROGRAM=$(MOZ_APP_NAME)$(BIN_SUFFIX)
diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index f4605c0ee9b5..f3b39ccf46a6 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -432,9 +432,11 @@ pref("full-screen-api.ignore-widgets", true);
pref("media.volume.steps", 10);
+#ifdef ENABLE_MARIONETTE
//Enable/disable marionette server, set listening port
pref("marionette.defaultPrefs.enabled", true);
pref("marionette.defaultPrefs.port", 2828);
+#endif
#ifdef MOZ_UPDATER
pref("app.update.enabled", true);
diff --git a/b2g/config/mozconfigs/gb_armv7a_gecko/debug b/b2g/config/mozconfigs/gb_armv7a_gecko/debug
index 2f2fc761a52f..5f14adf3c180 100644
--- a/b2g/config/mozconfigs/gb_armv7a_gecko/debug
+++ b/b2g/config/mozconfigs/gb_armv7a_gecko/debug
@@ -11,7 +11,7 @@ ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug
ac_add_options --with-ccache
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/config/mozconfigs/gb_armv7a_gecko/nightly b/b2g/config/mozconfigs/gb_armv7a_gecko/nightly
index 5ae933314dd4..31cd349250b2 100644
--- a/b2g/config/mozconfigs/gb_armv7a_gecko/nightly
+++ b/b2g/config/mozconfigs/gb_armv7a_gecko/nightly
@@ -11,7 +11,7 @@ ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-profiling
ac_add_options --with-ccache
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/debug b/b2g/config/mozconfigs/ics_armv7a_gecko/debug
index 73e866a12023..64e0fa88a3f2 100644
--- a/b2g/config/mozconfigs/ics_armv7a_gecko/debug
+++ b/b2g/config/mozconfigs/ics_armv7a_gecko/debug
@@ -14,7 +14,7 @@ ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug
#ac_add_options --with-ccache
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly
index 6bf1ba700afe..583b3a94d36a 100644
--- a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly
+++ b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly
@@ -14,7 +14,7 @@ ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-profiling
#ac_add_options --with-ccache
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
diff --git a/b2g/config/mozconfigs/linux32_gecko/nightly b/b2g/config/mozconfigs/linux32_gecko/nightly
index aaa7464b1667..3b7a2e833d5d 100644
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -33,6 +33,6 @@ ac_add_options --with-ccache=/usr/bin/ccache
#B2G options
ac_add_options --enable-application=b2g
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/config/mozconfigs/linux64_gecko/nightly b/b2g/config/mozconfigs/linux64_gecko/nightly
index 305d4087634c..fd23729b96df 100644
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -35,6 +35,6 @@ ac_add_options --with-ccache=/usr/bin/ccache
#B2G options
ac_add_options --enable-application=b2g
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/config/mozconfigs/macosx64_gecko/nightly b/b2g/config/mozconfigs/macosx64_gecko/nightly
index 62aabf060740..348edf231803 100644
--- a/b2g/config/mozconfigs/macosx64_gecko/nightly
+++ b/b2g/config/mozconfigs/macosx64_gecko/nightly
@@ -23,6 +23,6 @@ ac_add_options --enable-warnings-as-errors
ac_add_options --enable-application=b2g
ac_add_options --enable-debug-symbols
ac_add_options --with-ccache
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/config/mozconfigs/win32_gecko/nightly b/b2g/config/mozconfigs/win32_gecko/nightly
index 56d8dc7c9a83..affb7f1b1984 100644
--- a/b2g/config/mozconfigs/win32_gecko/nightly
+++ b/b2g/config/mozconfigs/win32_gecko/nightly
@@ -24,6 +24,6 @@ fi
# B2G Options
ac_add_options --enable-application=b2g
-ac_add_options --enable-marionette
+ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
diff --git a/b2g/confvars.sh b/b2g/confvars.sh
index aa9c25e98d36..82d209858424 100755
--- a/b2g/confvars.sh
+++ b/b2g/confvars.sh
@@ -38,6 +38,5 @@ fi
MOZ_APP_ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61}
MOZ_EXTENSION_MANAGER=1
-ENABLE_MARIONETTE=1
MOZ_SYS_MSG=1
diff --git a/b2g/installer/Makefile.in b/b2g/installer/Makefile.in
index 9bb1de88f527..ecd50bc58d4b 100644
--- a/b2g/installer/Makefile.in
+++ b/b2g/installer/Makefile.in
@@ -38,6 +38,10 @@ DEFINES += -DJAREXT=$(JAREXT)
include $(topsrcdir)/ipc/app/defs.mk
DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
+ifdef ENABLE_MARIONETTE
+DEFINES += -DENABLE_MARIONETTE=1
+endif
+
ifdef MOZ_PKG_MANIFEST_P
MOZ_PKG_MANIFEST = package-manifest
endif
diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in
index b9f21164ac4b..5de776e9f370 100644
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -675,10 +675,12 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
@BINPATH@/components/B2GComponents.xpt
@BINPATH@/components/CameraContent.js
@BINPATH@/@DLL_PREFIX@omxplugin@DLL_SUFFIX@
+#ifdef ENABLE_MARIONETTE
@BINPATH@/chrome/marionette@JAREXT@
@BINPATH@/chrome/marionette.manifest
@BINPATH@/components/MarionetteComponents.manifest
@BINPATH@/components/marionettecomponent.js
+#endif
@BINPATH@/components/AlertsService.js
@BINPATH@/components/ContentPermissionPrompt.js
#ifdef MOZ_UPDATER
diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
index 0d3ab5e4af25..5f891caa3596 100644
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -12,6 +12,10 @@ include $(DEPTH)/config/autoconf.mk
DIRS = profile/extensions
dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME)
+ifdef ENABLE_MARIONETTE
+DEFINES += -DENABLE_MARIONETTE=1
+endif
+
PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \
$(NULL)
diff --git a/browser/base/content/browser-social.js b/browser/base/content/browser-social.js
index 2f204f6d8e19..686095d7b741 100644
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -282,14 +282,6 @@ var SocialToolbar = {
init: function SocialToolbar_init() {
document.getElementById("social-provider-image").setAttribute("image", Social.provider.iconURL);
- let removeItem = document.getElementById("social-remove-menuitem");
- let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
- let label = gNavigatorBundle.getFormattedString("social.remove.label",
- [brandShortName]);
- let accesskey = gNavigatorBundle.getString("social.remove.accesskey");
- removeItem.setAttribute("label", label);
- removeItem.setAttribute("accesskey", accesskey);
-
let statusAreaPopup = document.getElementById("social-statusarea-popup");
statusAreaPopup.addEventListener("popupshown", function(e) {
this.button.setAttribute("open", "true");
@@ -344,23 +336,24 @@ var SocialToolbar = {
let iconNames = Object.keys(provider.ambientNotificationIcons);
let iconBox = document.getElementById("social-status-iconbox");
let notifBox = document.getElementById("social-notification-box");
- let notifBrowsers = document.createDocumentFragment();
+ let notificationFrames = document.createDocumentFragment();
let iconContainers = document.createDocumentFragment();
for each(let name in iconNames) {
let icon = provider.ambientNotificationIcons[name];
- let notifBrowserId = "social-status-" + icon.name;
- let notifBrowser = document.getElementById(notifBrowserId);
- if (!notifBrowser) {
- notifBrowser = document.createElement("iframe");
- notifBrowser.setAttribute("type", "content");
- notifBrowser.setAttribute("id", notifBrowserId);
- notifBrowsers.appendChild(notifBrowser);
+ let notificationFrameId = "social-status-" + icon.name;
+ let notificationFrame = document.getElementById(notificationFrameId);
+ if (!notificationFrame) {
+ notificationFrame = document.createElement("iframe");
+ notificationFrame.setAttribute("type", "content");
+ notificationFrame.setAttribute("id", notificationFrameId);
+ notificationFrame.setAttribute("mozbrowser", "true");
+ notificationFrames.appendChild(notificationFrame);
}
- notifBrowser.setAttribute("origin", provider.origin);
- if (notifBrowser.getAttribute("src") != icon.contentPanel)
- notifBrowser.setAttribute("src", icon.contentPanel);
+ notificationFrame.setAttribute("origin", provider.origin);
+ if (notificationFrame.getAttribute("src") != icon.contentPanel)
+ notificationFrame.setAttribute("src", icon.contentPanel);
let iconId = "social-notification-icon-" + icon.name;
let iconContainer = document.getElementById(iconId);
@@ -387,33 +380,27 @@ var SocialToolbar = {
}
if (iconImage.getAttribute("src") != icon.iconURL)
iconImage.setAttribute("src", icon.iconURL);
- iconImage.setAttribute("notifBrowserId", notifBrowserId);
+ iconImage.setAttribute("notificationFrameId", notificationFrameId);
iconCounter.collapsed = !icon.counter;
iconCounter.firstChild.textContent = icon.counter || "";
}
- notifBox.appendChild(notifBrowsers);
+ notifBox.appendChild(notificationFrames);
iconBox.appendChild(iconContainers);
-
- let browserIter = notifBox.firstElementChild;
- while (browserIter) {
- browserIter.docShell.isAppTab = true;
- browserIter = browserIter.nextElementSibling;
- }
},
showAmbientPopup: function SocialToolbar_showAmbientPopup(iconContainer) {
let iconImage = iconContainer.firstChild;
let panel = document.getElementById("social-notification-panel");
let notifBox = document.getElementById("social-notification-box");
- let notifBrowser = document.getElementById(iconImage.getAttribute("notifBrowserId"));
+ let notificationFrame = document.getElementById(iconImage.getAttribute("notificationFrameId"));
panel.hidden = false;
function sizePanelToContent() {
// FIXME: bug 764787: Maybe we can use nsIDOMWindowUtils.getRootBounds() here?
// Need to handle dynamic sizing
- let doc = notifBrowser.contentDocument;
+ let doc = notificationFrame.contentDocument;
if (!doc) {
return;
}
@@ -426,23 +413,23 @@ var SocialToolbar = {
// Clear dimensions on all browsers so the panel size will
// only use the selected browser.
- let browserIter = notifBox.firstElementChild;
- while (browserIter) {
- browserIter.hidden = (browserIter != notifBrowser);
- browserIter = browserIter.nextElementSibling;
+ let frameIter = notifBox.firstElementChild;
+ while (frameIter) {
+ frameIter.hidden = (frameIter != notificationFrame);
+ frameIter = frameIter.nextElementSibling;
}
let [height, width] = [body.firstChild.offsetHeight || 300, 330];
- notifBrowser.style.width = width + "px";
- notifBrowser.style.height = height + "px";
+ notificationFrame.style.width = width + "px";
+ notificationFrame.style.height = height + "px";
}
sizePanelToContent();
function dispatchPanelEvent(name) {
- let evt = notifBrowser.contentDocument.createEvent("CustomEvent");
+ let evt = notificationFrame.contentDocument.createEvent("CustomEvent");
evt.initCustomEvent(name, true, true, {});
- notifBrowser.contentDocument.documentElement.dispatchEvent(evt);
+ notificationFrame.contentDocument.documentElement.dispatchEvent(evt);
}
panel.addEventListener("popuphiding", function onpopuphiding() {
@@ -454,12 +441,13 @@ var SocialToolbar = {
panel.addEventListener("popupshown", function onpopupshown() {
panel.removeEventListener("popupshown", onpopupshown);
SocialToolbar.button.setAttribute("open", "true");
- if (notifBrowser.contentDocument.readyState == "complete") {
+ notificationFrame.docShell.isAppTab = true;
+ if (notificationFrame.contentDocument.readyState == "complete") {
dispatchPanelEvent("socialFrameShow");
} else {
// first time load, wait for load and dispatch after load
- notifBrowser.addEventListener("load", function panelBrowserOnload(e) {
- notifBrowser.removeEventListener("load", panelBrowserOnload, true);
+ notificationFrame.addEventListener("load", function panelBrowserOnload(e) {
+ notificationFrame.removeEventListener("load", panelBrowserOnload, true);
setTimeout(function() {
dispatchPanelEvent("socialFrameShow");
}, 0);
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 3d018dc07f47..f14f649baa94 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1286,9 +1286,7 @@ var gBrowserInit = {
UpdateUrlbarSearchSplitterState();
- if (isLoadingBlank && gURLBar)
- gURLBar.focus();
- if (!isLoadingBlank || !gURLBar || !gURLBar.focused)
+ if (!isLoadingBlank || !focusAndSelectUrlBar())
gBrowser.selectedBrowser.focus();
gNavToolbox.customizeDone = BrowserToolboxCustomizeDone;
@@ -1990,7 +1988,7 @@ function focusAndSelectUrlBar() {
FullScreen.mouseoverToggle(true);
gURLBar.focus();
- if (gURLBar.focused) {
+ if (document.activeElement == gURLBar.inputField) {
gURLBar.select();
return true;
}
@@ -3350,7 +3348,7 @@ const BrowserSearch = {
FullScreen.mouseoverToggle(true);
if (searchBar)
searchBar.focus();
- if (searchBar && searchBar.textbox.focused) {
+ if (searchBar && document.activeElement == searchBar.textbox.inputField) {
searchBar.select();
} else {
openUILinkIn(Services.search.defaultEngine.searchForm, "current");
diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul
index 9573c0867801..764543abc9e4 100644
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -674,8 +674,6 @@
oncommand="SocialUI.showProfile(); document.getElementById('social-statusarea-popup').hidePopup();"/>
-