зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1422985. Send JSON encoded preferences via the details param. r=Gijs
MozReview-Commit-ID: J2GGaehiYlH --HG-- extra : rebase_source : 699b54066fbadf58031cc593b06590fc352bc5b4
This commit is contained in:
Родитель
32df3a47a8
Коммит
04cc210cfd
|
@ -9,8 +9,6 @@ let { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
|||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const PREF_STYLO_ENABLED = "layout.css.servo.enabled";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PageActions",
|
||||
"resource:///modules/PageActions.jsm");
|
||||
|
||||
|
@ -19,6 +17,10 @@ XPCOMUtils.defineLazyGetter(this, "wcStrings", function() {
|
|||
"chrome://webcompat-reporter/locale/webcompat.properties");
|
||||
});
|
||||
|
||||
// Gather values for prefs we want to appear in reports.
|
||||
let prefs = {};
|
||||
XPCOMUtils.defineLazyPreferenceGetter(prefs, "layout.css.servo.enabled", "layout.css.servo.enabled", false);
|
||||
|
||||
let WebCompatReporter = {
|
||||
get endpoint() {
|
||||
return Services.urlFormatter.formatURLPref(
|
||||
|
@ -79,14 +81,14 @@ let WebCompatReporter = {
|
|||
const FRAMESCRIPT = "chrome://webcompat-reporter/content/wc-frame.js";
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const WEBCOMPAT_ORIGIN = new win.URL(WebCompatReporter.endpoint).origin;
|
||||
let styloEnabled = Services.prefs.getBoolPref(PREF_STYLO_ENABLED, false);
|
||||
|
||||
let params = new URLSearchParams();
|
||||
params.append("url", `${tabData.url}`);
|
||||
params.append("src", "desktop-reporter");
|
||||
if (styloEnabled) {
|
||||
params.append("details", "layout.css.servo.enabled: true");
|
||||
params.append("label", "type-stylo");
|
||||
params.append("details", JSON.stringify(prefs));
|
||||
|
||||
if (prefs["layout.css.servo.enabled"]) {
|
||||
params.append("label", "type-stylo");
|
||||
}
|
||||
|
||||
let tab = gBrowser.loadOneTab(
|
||||
|
|
Загрузка…
Ссылка в новой задаче