зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1480610 - Implement Firefox Monitor add-on stub. r=johannh
This commit is contained in:
Родитель
6b47da6dac
Коммит
d60e939f6a
|
@ -0,0 +1 @@
|
|||
browser.fxmonitor.start();
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Firefox Monitor",
|
||||
"version": "2.0",
|
||||
"background": {
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "fxmonitor@mozilla.org",
|
||||
"strict_min_version": "62.0"
|
||||
}
|
||||
},
|
||||
"experiment_apis": {
|
||||
"fxmonitor": {
|
||||
"schema": "./privileged/schema.json",
|
||||
"parent": {
|
||||
"scopes": ["addon_parent"],
|
||||
"script": "./privileged/api.js",
|
||||
"paths": [["fxmonitor"]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "Firefox Monitor")
|
||||
|
||||
FINAL_TARGET_FILES.features['fxmonitor@mozilla.org'] += [
|
||||
'background.js',
|
||||
'manifest.json'
|
||||
]
|
||||
|
||||
FINAL_TARGET_FILES.features['fxmonitor@mozilla.org']['privileged'] += [
|
||||
'privileged/api.js',
|
||||
'privileged/FirefoxMonitor.jsm',
|
||||
'privileged/schema.json'
|
||||
]
|
|
@ -0,0 +1,14 @@
|
|||
ChromeUtils.defineModuleGetter(this, "Preferences",
|
||||
"resource://gre/modules/Preferences.jsm");
|
||||
|
||||
this.FirefoxMonitor = {
|
||||
kEnabledPref: "extensions.fxmonitor.enabled",
|
||||
extension: null,
|
||||
init(aExtension) {
|
||||
this.extension = aExtension;
|
||||
|
||||
if (!Preferences.get(this.kEnabledPref, false)) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
|
||||
this.fxmonitor = class extends ExtensionAPI {
|
||||
getAPI(context) {
|
||||
const FirefoxMonitorContainer = {};
|
||||
Services.scriptloader.loadSubScript(
|
||||
context.extension.getURL("privileged/FirefoxMonitor.jsm"),
|
||||
FirefoxMonitorContainer);
|
||||
return {
|
||||
fxmonitor: {
|
||||
async start() {
|
||||
FirefoxMonitorContainer.FirefoxMonitor.init(context.extension);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
[
|
||||
{
|
||||
"namespace": "fxmonitor",
|
||||
"functions": [
|
||||
{
|
||||
"name": "start",
|
||||
"type": "function",
|
||||
"async": true,
|
||||
"parameters": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -7,6 +7,7 @@
|
|||
DIRS += [
|
||||
'aushelper',
|
||||
'formautofill',
|
||||
'fxmonitor',
|
||||
'onboarding',
|
||||
'pdfjs',
|
||||
'pocket',
|
||||
|
|
Загрузка…
Ссылка в новой задаче