2019-02-22 02:04:13 +03:00
|
|
|
/* 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"];
|
|
|
|
|
2019-03-10 15:51:05 +03:00
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
2019-02-22 02:04:13 +03:00
|
|
|
const { Domain } = ChromeUtils.import(
|
|
|
|
"chrome://remote/content/domains/Domain.jsm"
|
|
|
|
);
|
|
|
|
|
|
|
|
class Browser extends Domain {
|
|
|
|
getVersion() {
|
2019-06-20 17:36:19 +03:00
|
|
|
const { isHeadless } = Cc["@mozilla.org/gfx/info;1"].getService(
|
|
|
|
Ci.nsIGfxInfo
|
|
|
|
);
|
2019-06-21 12:15:00 +03:00
|
|
|
const { userAgent } = Cc[
|
|
|
|
"@mozilla.org/network/protocol;1?name=http"
|
|
|
|
].getService(Ci.nsIHttpProtocolHandler);
|
2019-02-22 02:04:13 +03:00
|
|
|
return {
|
2020-05-14 09:07:38 +03:00
|
|
|
protocolVersion: "1.3",
|
2019-06-20 17:36:19 +03:00
|
|
|
product: (isHeadless ? "Headless " : "") + "Firefox",
|
2019-02-22 02:04:13 +03:00
|
|
|
revision: "1",
|
2019-06-21 12:15:00 +03:00
|
|
|
userAgent,
|
2019-02-22 02:04:13 +03:00
|
|
|
jsVersion: "1.8.5",
|
|
|
|
};
|
|
|
|
}
|
2019-03-10 15:51:05 +03:00
|
|
|
|
|
|
|
close() {
|
|
|
|
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit);
|
|
|
|
}
|
2019-02-22 02:04:13 +03:00
|
|
|
}
|