summaryrefslogtreecommitdiffstats
path: root/remote/domains/parent/Browser.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'remote/domains/parent/Browser.jsm')
-rw-r--r--remote/domains/parent/Browser.jsm34
1 files changed, 34 insertions, 0 deletions
diff --git a/remote/domains/parent/Browser.jsm b/remote/domains/parent/Browser.jsm
new file mode 100644
index 0000000000..9e496e52f6
--- /dev/null
+++ b/remote/domains/parent/Browser.jsm
@@ -0,0 +1,34 @@
+/* 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";
+
+var EXPORTED_SYMBOLS = ["Browser"];
+
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Domain } = ChromeUtils.import(
+ "chrome://remote/content/domains/Domain.jsm"
+);
+
+class Browser extends Domain {
+ getVersion() {
+ const { isHeadless } = Cc["@mozilla.org/gfx/info;1"].getService(
+ Ci.nsIGfxInfo
+ );
+ const { userAgent } = Cc[
+ "@mozilla.org/network/protocol;1?name=http"
+ ].getService(Ci.nsIHttpProtocolHandler);
+ return {
+ protocolVersion: "1.3",
+ product: (isHeadless ? "Headless " : "") + "Firefox",
+ revision: "1",
+ userAgent,
+ jsVersion: "1.8.5",
+ };
+ }
+
+ close() {
+ Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit);
+ }
+}