Bug 1463924 - Remove Dev. Edition promo doorhanger. r=nchevobbe draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 23 May 2018 18:30:36 -0500
changeset 799411 49e7a5401a85f5508154dde8f6b0084dd9c8c64c
parent 797745 77c06979d9e88979ec96263eccdbd750cb9221a4
push id111043
push userbmo:jryans@gmail.com
push dateThu, 24 May 2018 16:16:30 +0000
reviewersnchevobbe
bugs1463924
milestone62.0a1
Bug 1463924 - Remove Dev. Edition promo doorhanger. r=nchevobbe MozReview-Commit-ID: LIg6o35CvD2
devtools/client/framework/dev-edition-promo/dev-edition-logo.png
devtools/client/framework/dev-edition-promo/dev-edition-promo.css
devtools/client/framework/dev-edition-promo/dev-edition-promo.xul
devtools/client/framework/toolbox.js
devtools/client/jar.mn
devtools/client/preferences/devtools-client.js
devtools/client/shared/doorhanger.js
devtools/client/shared/moz.build
devtools/client/webconsole/hudservice.js
devtools/client/webide/content/webide.js
testing/profiles/unittest/user.js
deleted file mode 100644
index 7f753ff20600f017bdf78c36b628587c4aa0d311..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/devtools/client/framework/dev-edition-promo/dev-edition-promo.css
+++ /dev/null
@@ -1,94 +0,0 @@
-/* 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/. */
-
-window {
-  -moz-appearance: none;
-  background-color: transparent;
-}
-
-#doorhanger-container {
-  width: 450px;
-}
-
-#top-panel {
-  padding: 20px;
-  background: #343c45; /* toolbars */
-  color: #8fa1b2; /* body text */
-/*
- * Sloppy preprocessing since UNIX_BUT_NOT_MAC is only defined
- * in `browser/app/profile/firefox.js`, which this file cannot
- * depend on. Must style font-size to target linux.
- */
-%ifdef XP_UNIX
-%ifndef XP_MACOSX
-  font-size: 13px;
-%else
-  font-size: 15px;
-%endif
-%else
-  font-size: 15px;
-%endif
-  line-height: 19px;
-  min-height: 100px;
-}
-
-#top-panel h1 {
-  font-weight: bold;
-  font-family: Open Sans, sans-serif;
-  font-size: 1.1em;
-}
-
-#top-panel p {
-  font-family: Open Sans, sans-serif;
-  font-size: 0.9em;
-  width: 300px;
-  display: block;
-  margin: 5px 0px 0px 0px;
-}
-
-#icon {
-  background-image: url("chrome://devtools/content/framework/dev-edition-promo/dev-edition-logo.png");
-  background-size: 64px 64px;
-  background-repeat: no-repeat;
-  width: 64px;
-  height: 64px;
-  margin-right: 20px;
-}
-
-#lower-panel {
-  padding: 20px;
-  background-color: #252c33; /* tab toolbars */
-  min-height: 75px;
-  border-top: 1px solid #292e33; /* text high contrast (light) */
-}
-
-#button-container {
-  margin: auto 20px;
-}
-
-#button-container button {
-  font: message-box !important;
-  font-size: 16px !important;
-  cursor: pointer;
-  width: 125px;
-  opacity: 1;
-  position: static;
-  -moz-appearance: none;
-  border-radius: 5px;
-  height: 30px;
-  width: 450px;
-  /* Override embossed borders on Windows/Linux */
-  border: none;
-}
-
-#close {
-  background-color: transparent;
-  color: #8fa1b2; /* body text */
-}
-
-#go {
-  margin-left: 100px;
-  background-color: #70bf53; /* green */
-  color: #f5f7fa; /* selection text color */
-}
deleted file mode 100644
--- a/devtools/client/framework/dev-edition-promo/dev-edition-promo.xul
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-<!DOCTYPE window [
-<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
- %toolboxDTD;
-]>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet rel="stylesheet" href="chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="dev-edition-promo">
-  <vbox id="doorhanger-container">
-    <hbox flex="1" id="top-panel">
-      <image id="icon" />
-      <vbox id="info">
-        <h1>Using Developer Tools in your browser?</h1>
-        <p>Download Firefox Developer Edition, our first browser made just for you.</p>
-      </vbox>
-    </hbox>
-    <hbox id="lower-panel" flex="1">
-      <hbox id="button-container" flex="1">
-        <button id="close"
-                flex="1"
-                standalone="true"
-                label="No thanks">
-        </button>
-        <button id="go"
-                flex="1"
-                standalone="true"
-                label="Learn more »">
-        </button>
-      </hbox>
-    </hbox>
-  </vbox>
-</window>
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -42,18 +42,16 @@ const L10N = new LocalizationHelper("dev
 loader.lazyRequireGetter(this, "getHighlighterUtils",
   "devtools/client/framework/toolbox-highlighter-utils", true);
 loader.lazyRequireGetter(this, "Selection",
   "devtools/client/framework/selection", true);
 loader.lazyRequireGetter(this, "InspectorFront",
   "devtools/shared/fronts/inspector", true);
 loader.lazyRequireGetter(this, "flags",
   "devtools/shared/flags");
-loader.lazyRequireGetter(this, "showDoorhanger",
-  "devtools/client/shared/doorhanger", true);
 loader.lazyRequireGetter(this, "createPerformanceFront",
   "devtools/shared/fronts/performance", true);
 loader.lazyRequireGetter(this, "system",
   "devtools/shared/system");
 loader.lazyRequireGetter(this, "getPreferenceFront",
   "devtools/shared/fronts/preference", true);
 loader.lazyRequireGetter(this, "KeyShortcuts",
   "devtools/client/shared/key-shortcuts");
@@ -142,17 +140,16 @@ function Toolbox(target, selectedTool, h
   this._highlighterReady = this._highlighterReady.bind(this);
   this._highlighterHidden = this._highlighterHidden.bind(this);
   this._applyCacheSettings = this._applyCacheSettings.bind(this);
   this._applyServiceWorkersTestingSettings =
     this._applyServiceWorkersTestingSettings.bind(this);
   this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
   this._onFocus = this._onFocus.bind(this);
   this._onBrowserMessage = this._onBrowserMessage.bind(this);
-  this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
   this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
   this._onPerformanceFrontEvent = this._onPerformanceFrontEvent.bind(this);
   this._onTabsOrderUpdated = this._onTabsOrderUpdated.bind(this);
   this._onToolbarFocus = this._onToolbarFocus.bind(this);
   this._onToolbarArrowKeypress = this._onToolbarArrowKeypress.bind(this);
   this._onPickerClick = this._onPickerClick.bind(this);
   this._onPickerKeypress = this._onPickerKeypress.bind(this);
   this._onPickerStarted = this._onPickerStarted.bind(this);
@@ -182,17 +179,16 @@ function Toolbox(target, selectedTool, h
 
   this._target.on("will-navigate", this._onWillNavigate);
   this._target.on("navigate", this._refreshHostTitle);
   this._target.on("frame-update", this._updateFrames);
   this._target.on("inspect-object", this._onInspectObject);
 
   this.on("host-changed", this._refreshHostTitle);
   this.on("select", this._onToolSelected);
-  this.on("ready", this._showDevEditionPromo);
 
   gDevTools.on("tool-registered", this._toolRegistered);
   gDevTools.on("tool-unregistered", this._toolUnregistered);
 
   this.on("picker-started", this._onPickerStarted);
   this.on("picker-stopped", this._onPickerStopped);
 
   /**
@@ -2760,17 +2756,16 @@ Toolbox.prototype = {
     this.emit("destroy");
 
     this._target.off("inspect-object", this._onInspectObject);
     this._target.off("will-navigate", this._onWillNavigate);
     this._target.off("navigate", this._refreshHostTitle);
     this._target.off("frame-update", this._updateFrames);
     this.off("select", this._onToolSelected);
     this.off("host-changed", this._refreshHostTitle);
-    this.off("ready", this._showDevEditionPromo);
 
     gDevTools.off("tool-registered", this._toolRegistered);
     gDevTools.off("tool-unregistered", this._toolUnregistered);
 
     Services.prefs.removeObserver("devtools.cache.disabled", this._applyCacheSettings);
     Services.prefs.removeObserver("devtools.serviceWorkers.testing.enabled",
                                   this._applyServiceWorkersTestingSettings);
 
@@ -2960,28 +2955,16 @@ Toolbox.prototype = {
     this.emit("highlighter-ready");
   },
 
   _highlighterHidden: function() {
     this.emit("highlighter-hide");
   },
 
   /**
-   * For displaying the promotional Doorhanger on first opening of
-   * the developer tools, promoting the Developer Edition.
-   */
-  _showDevEditionPromo: function() {
-    // Do not display in browser toolbox
-    if (this.target.chrome) {
-      return;
-    }
-    showDoorhanger({ window: this.win, type: "deveditionpromo" });
-  },
-
-  /**
    * Enable / disable necessary textbox menu items using globalOverlay.js.
    */
   _updateTextBoxMenuItems: function() {
     let window = this.win;
     ["cmd_undo", "cmd_delete", "cmd_cut",
      "cmd_copy", "cmd_paste", "cmd_selectAll"].forEach(window.goUpdateCommand);
   },
 
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -78,19 +78,16 @@ devtools.jar:
     content/memory/memory.xhtml (memory/memory.xhtml)
     content/framework/toolbox-window.xul (framework/toolbox-window.xul)
     content/framework/toolbox-options.xhtml (framework/toolbox-options.xhtml)
 *   content/framework/toolbox.xul (framework/toolbox.xul)
     content/framework/toolbox-init.js (framework/toolbox-init.js)
     content/framework/options-panel.css (framework/options-panel.css)
     content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
     content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
-    content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
-*   content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
-    content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
     content/inspector/inspector.xhtml (inspector/inspector.xhtml)
     content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
     content/framework/connect/connect.css (framework/connect/connect.css)
     content/framework/connect/connect.js (framework/connect/connect.js)
     content/shared/widgets/graphs-frame.xhtml (shared/widgets/graphs-frame.xhtml)
     content/shared/widgets/cubic-bezier.css (shared/widgets/cubic-bezier.css)
     content/shared/widgets/filter-widget.css (shared/widgets/filter-widget.css)
     content/shared/widgets/spectrum.css (shared/widgets/spectrum.css)
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -1,23 +1,12 @@
 /* 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/. */
 
-// Developer edition promo preferences
-pref("devtools.devedition.promo.shown", false);
-pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
-
-// Only potentially show in beta release
-#if MOZ_UPDATE_CHANNEL == beta
-  pref("devtools.devedition.promo.enabled", true);
-#else
-  pref("devtools.devedition.promo.enabled", false);
-#endif
-
 // Enable DevTools WebIDE by default
 pref("devtools.webide.enabled", true);
 
 // Toolbox preferences
 pref("devtools.toolbox.footer.height", 250);
 pref("devtools.toolbox.sidebar.width", 500);
 pref("devtools.toolbox.host", "bottom");
 pref("devtools.toolbox.previousHost", "side");
deleted file mode 100644
--- a/devtools/client/shared/doorhanger.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-const Services = require("Services");
-const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
-
-const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
-const DEV_EDITION_PROMO_ENABLED_PREF = "devtools.devedition.promo.enabled";
-const DEV_EDITION_PROMO_SHOWN_PREF = "devtools.devedition.promo.shown";
-const DEV_EDITION_PROMO_URL_PREF = "devtools.devedition.promo.url";
-
-/**
- * Only show Dev Edition promo if it's enabled (beta channel),
- * if it has not been shown before, and it's a locale build
- * for `en-US`
- */
-function shouldDevEditionPromoShow() {
-  return Services.prefs.getBoolPref(DEV_EDITION_PROMO_ENABLED_PREF) &&
-         !Services.prefs.getBoolPref(DEV_EDITION_PROMO_SHOWN_PREF) &&
-         Services.locale.getAppLocaleAsLangTag() === "en-US";
-}
-
-var TYPES = {
-  // The Developer Edition promo doorhanger, called by
-  // opening the toolbox, browser console, WebIDE, or responsive design mode
-  // in Beta releases. Only displayed once per profile.
-  deveditionpromo: {
-    predicate: shouldDevEditionPromoShow,
-    success: () => {
-      return Services.prefs.setBoolPref(DEV_EDITION_PROMO_SHOWN_PREF, true);
-    },
-    action: () => {
-      let url = Services.prefs.getCharPref(DEV_EDITION_PROMO_URL_PREF);
-      getGBrowser().selectedTab = getGBrowser().addTab(url);
-    },
-    url: DEV_EDITION_PROMO_URL
-  }
-};
-
-var panelAttrs = {
-  orient: "vertical",
-  hidden: "false",
-  consumeoutsideclicks: "true",
-  noautofocus: "true",
-  align: "start",
-  role: "alert"
-};
-
-/**
- * Helper to call a doorhanger, defined in `TYPES`, with defined conditions,
- * success handlers and loads its own XUL in a frame. Takes an object with
- * several properties:
- *
- * @param {XULWindow} window
- *        The window that should house the doorhanger.
- * @param {String} type
- *        The type of doorhanger to be displayed is, using the `TYPES`
- *        definition.
- * @param {String} selector
- *        The selector that the doorhanger should be appended to within
- *        `window`.  Defaults to a XUL Document's `window` element.
- */
-exports.showDoorhanger = async function({ window, type, anchor }) {
-  let { predicate, success, url, action } = TYPES[type];
-  // Abort if predicate fails
-  if (!predicate()) {
-    return;
-  }
-
-  // Call success function to set preferences/cleanup immediately,
-  // so if triggered multiple times, only happens once (Windows/Linux)
-  success();
-
-  // Wait 200ms to prevent flickering where the popup is displayed
-  // before the underlying window (Windows 7, 64bit)
-  await wait(200);
-
-  let document = window.document;
-
-  let panel = document.createElementNS(XULNS, "panel");
-  let frame = document.createElementNS(XULNS, "iframe");
-  let parentEl = document.querySelector("window");
-
-  frame.setAttribute("src", url);
-  let close = () => parentEl.removeChild(panel);
-
-  setDoorhangerStyle(panel, frame);
-
-  panel.appendChild(frame);
-  parentEl.appendChild(panel);
-
-  await onFrameLoad(frame);
-
-  panel.openPopup(anchor);
-
-  let closeBtn = frame.contentDocument.querySelector("#close");
-  if (closeBtn) {
-    closeBtn.addEventListener("click", close);
-  }
-
-  let goBtn = frame.contentDocument.querySelector("#go");
-  if (goBtn) {
-    goBtn.addEventListener("click", () => {
-      if (action) {
-        action();
-      }
-      close();
-    });
-  }
-};
-
-function setDoorhangerStyle(panel, frame) {
-  Object.keys(panelAttrs).forEach(prop => {
-    return panel.setAttribute(prop, panelAttrs[prop]);
-  });
-  panel.style.margin = "20px";
-  panel.style.borderRadius = "5px";
-  panel.style.border = "none";
-  panel.style.MozAppearance = "none";
-  panel.style.backgroundColor = "transparent";
-
-  frame.style.borderRadius = "5px";
-  frame.setAttribute("flex", "1");
-  frame.setAttribute("width", "450");
-  frame.setAttribute("height", "179");
-}
-
-function onFrameLoad(frame) {
-  return new Promise((resolve, reject) => {
-    if (frame.contentWindow) {
-      let domHelper = new DOMHelpers(frame.contentWindow);
-      domHelper.onceDOMReady(resolve);
-    } else {
-      let callback = () => {
-        frame.removeEventListener("DOMContentLoaded", callback);
-        resolve();
-      };
-      frame.addEventListener("DOMContentLoaded", callback);
-    }
-  });
-}
-
-function getGBrowser() {
-  return Services.wm.getMostRecentWindow("navigator:browser").gBrowser;
-}
-
-function wait(n) {
-  return new Promise((resolve, reject) => {
-    setTimeout(resolve, n);
-  });
-}
--- a/devtools/client/shared/moz.build
+++ b/devtools/client/shared/moz.build
@@ -24,17 +24,16 @@ DevToolsModules(
     'autocomplete-popup.js',
     'browser-loader.js',
     'css-angle.js',
     'curl.js',
     'demangle.js',
     'developer-toolbar.js',
     'devices.js',
     'DOMHelpers.jsm',
-    'doorhanger.js',
     'enum.js',
     'file-saver.js',
     'getjson.js',
     'inplace-editor.js',
     'key-shortcuts.js',
     'keycodes.js',
     'link.js',
     'natural-sort.js',
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -9,17 +9,16 @@ loader.lazyRequireGetter(this, "Utils", 
 loader.lazyRequireGetter(this, "extend", "devtools/shared/extend", true);
 loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
 loader.lazyRequireGetter(this, "Tools", "devtools/client/definitions", true);
 loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
 loader.lazyRequireGetter(this, "NewWebConsoleFrame", "devtools/client/webconsole/new-webconsole", true);
 loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
 loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
 loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/debugger-client", true);
-loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger", true);
 loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source");
 loader.lazyRequireGetter(this, "l10n", "devtools/client/webconsole/webconsole-l10n");
 const BC_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
 
 // The preference prefix for all of the Browser Console filters.
 const BC_FILTER_PREFS_PREFIX = "devtools.browserconsole.filter.";
 
 var gHudId = 0;
@@ -593,28 +592,21 @@ BrowserConsole.prototype = extend(WebCon
 
     this.ui._filterPrefsPrefix = BC_FILTER_PREFS_PREFIX;
 
     let window = this.iframeWindow;
 
     // Make sure that the closing of the Browser Console window destroys this
     // instance.
     window.addEventListener("unload", () => {
-      window.removeEventListener("focus", onFocus);
       this.destroy();
     }, {once: true});
 
     this._telemetry.toolOpened("browserconsole");
 
-    // Create an onFocus handler just to display the dev edition promo.
-    // This is to prevent race conditions in some environments.
-    // Hook to display promotional Developer Edition doorhanger. Only displayed once.
-    let onFocus = () => showDoorhanger({ window, type: "deveditionpromo" });
-    window.addEventListener("focus", onFocus);
-
     this._bcInit = this.$init();
     return this._bcInit;
   },
 
   $destroy: WebConsole.prototype.destroy,
 
   /**
    * Destroy the object.
--- a/devtools/client/webide/content/webide.js
+++ b/devtools/client/webide/content/webide.js
@@ -15,17 +15,16 @@ const {AppProjects} = require("devtools/
 const {Connection} = require("devtools/shared/client/connection-manager");
 const {AppManager} = require("devtools/client/webide/modules/app-manager");
 const EventEmitter = require("devtools/shared/event-emitter");
 const promise = require("promise");
 const {GetAvailableAddons} = require("devtools/client/webide/modules/addons");
 const {getJSON} = require("devtools/client/shared/getjson");
 const Telemetry = require("devtools/client/shared/telemetry");
 const {RuntimeScanners} = require("devtools/client/webide/modules/runtimes");
-const {showDoorhanger} = require("devtools/client/shared/doorhanger");
 
 const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
 
 const HELP_URL = "https://developer.mozilla.org/docs/Tools/WebIDE/Troubleshooting";
 
 const MAX_ZOOM = 1.4;
 const MIN_ZOOM = 0.6;
 
@@ -111,21 +110,16 @@ var UI = {
     // if a modification happened, it happened when the window was
     // not focused.
     if (AppManager.selectedProject &&
         AppManager.selectedProject.type != "mainProcess" &&
         AppManager.selectedProject.type != "runtimeApp" &&
         AppManager.selectedProject.type != "tab") {
       AppManager.validateAndUpdateProject(AppManager.selectedProject);
     }
-
-    // Hook to display promotional Developer Edition doorhanger. Only displayed once.
-    // Hooked into the `onfocus` event because sometimes does not work
-    // when run at the end of `init`. ¯\(°_o)/¯
-    showDoorhanger({ window, type: "deveditionpromo", anchor: document.querySelector("#deck") });
   },
 
   appManagerUpdate: function(what, details) {
     // Got a message from app-manager.js
     // See AppManager.update() for descriptions of what these events mean.
     switch (what) {
       case "runtime-list":
         this.autoConnectRuntime();
--- a/testing/profiles/unittest/user.js
+++ b/testing/profiles/unittest/user.js
@@ -87,17 +87,16 @@ user_pref("captivedetect.canonicalURL", 
 // works. It just can't hit the default production endpoint.
 user_pref("datareporting.healthreport.documentServerURI", "http://{server}/healthreport/");
 user_pref("datareporting.healthreport.uploadEnabled", false);
 user_pref("devtools.browsertoolbox.panel", "jsdebugger");
 user_pref("devtools.chrome.enabled", false);
 user_pref("devtools.debugger.prompt-connection", true);
 user_pref("devtools.debugger.remote-enabled", false);
 user_pref("devtools.debugger.remote-port", 6023);
-user_pref("devtools.devedition.promo.enabled", false);
 user_pref("devtools.testing", true);
 user_pref("dom.allow_scripts_to_close_windows", true);
 user_pref("dom.disable_open_during_load", false);
 user_pref("dom.experimental_forms", true); // on for testing
 user_pref("dom.forms.color", true); // on for testing
 user_pref("dom.forms.datetime", true); // on for testing
 user_pref("dom.forms.datetime.others", true); // on for testing
 // Enable Gamepad