mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 862353 - Remove NavigatorPropertyHelper. r=bent
This commit is contained in:
parent
9fdab01a57
commit
699deca5bc
@ -352,8 +352,6 @@
|
|||||||
@BINPATH@/components/BrowserElementParent.js
|
@BINPATH@/components/BrowserElementParent.js
|
||||||
@BINPATH@/components/ContactManager.js
|
@BINPATH@/components/ContactManager.js
|
||||||
@BINPATH@/components/ContactManager.manifest
|
@BINPATH@/components/ContactManager.manifest
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.js
|
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.manifest
|
|
||||||
@BINPATH@/components/PermissionSettings.js
|
@BINPATH@/components/PermissionSettings.js
|
||||||
@BINPATH@/components/PermissionSettings.manifest
|
@BINPATH@/components/PermissionSettings.manifest
|
||||||
@BINPATH@/components/PermissionPromptService.js
|
@BINPATH@/components/PermissionPromptService.js
|
||||||
|
@ -515,8 +515,6 @@
|
|||||||
@BINPATH@/components/PermissionSettings.manifest
|
@BINPATH@/components/PermissionSettings.manifest
|
||||||
@BINPATH@/components/ContactManager.js
|
@BINPATH@/components/ContactManager.js
|
||||||
@BINPATH@/components/ContactManager.manifest
|
@BINPATH@/components/ContactManager.manifest
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.js
|
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.manifest
|
|
||||||
@BINPATH@/components/AlarmsManager.js
|
@BINPATH@/components/AlarmsManager.js
|
||||||
@BINPATH@/components/AlarmsManager.manifest
|
@BINPATH@/components/AlarmsManager.manifest
|
||||||
@BINPATH@/components/TCPSocket.js
|
@BINPATH@/components/TCPSocket.js
|
||||||
|
@ -19,8 +19,6 @@ EXTRA_COMPONENTS = \
|
|||||||
SiteSpecificUserAgent.manifest \
|
SiteSpecificUserAgent.manifest \
|
||||||
ConsoleAPI.js \
|
ConsoleAPI.js \
|
||||||
ConsoleAPI.manifest \
|
ConsoleAPI.manifest \
|
||||||
NavigatorPropertyHelper.js \
|
|
||||||
NavigatorPropertyHelper.manifest \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_JS_MODULES = ConsoleAPIStorage.jsm \
|
EXTRA_JS_MODULES = ConsoleAPIStorage.jsm \
|
||||||
|
@ -1,77 +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 DEBUG = false;
|
|
||||||
function debug(s) { dump("-*- NavigatorPropertyHelper: " + s + "\n"); }
|
|
||||||
|
|
||||||
const Ci = Components.interfaces;
|
|
||||||
const Cu = Components.utils;
|
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
Cu.import("resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
function NavigatorPropertyHelper() { };
|
|
||||||
|
|
||||||
NavigatorPropertyHelper.prototype = {
|
|
||||||
|
|
||||||
classID : Components.ID("{f0d03420-a0ce-11e2-9e96-0800200c9a66}"),
|
|
||||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|
||||||
|
|
||||||
observe: function observe(subject, topic, data) {
|
|
||||||
if (DEBUG) debug("topic: " + topic + ", data: " + data);
|
|
||||||
let cm = Components.classes["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
|
|
||||||
|
|
||||||
let enableAndAddObserver = function(oldCategory, newCategory) {
|
|
||||||
let enumerator = cm.enumerateCategory(oldCategory);
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let entry = enumerator.getNext().QueryInterface(Ci.nsISupportsCString);
|
|
||||||
let keyVal = cm.getCategoryEntry(oldCategory, entry).split(',');
|
|
||||||
try {
|
|
||||||
if (Services.prefs.getBoolPref(entry)) {
|
|
||||||
if (DEBUG) debug("enable: " + keyVal[0]);
|
|
||||||
cm.addCategoryEntry(newCategory, keyVal[0], keyVal[1], false, false);
|
|
||||||
}
|
|
||||||
} catch (ex) {
|
|
||||||
if (DEBUG) debug("no pref found: " + entry);
|
|
||||||
}
|
|
||||||
Services.prefs.addObserver(entry, this, true);
|
|
||||||
}
|
|
||||||
}.bind(this);
|
|
||||||
|
|
||||||
function addOrRemoveCategory(oldCategory, newCategory) {
|
|
||||||
let keyVal = cm.getCategoryEntry(oldCategory, data).split(',');
|
|
||||||
let key = keyVal[0];
|
|
||||||
let val = keyVal[1];
|
|
||||||
try {
|
|
||||||
if (Services.prefs.getBoolPref(data)) {
|
|
||||||
if (DEBUG) debug("enable: " + key);
|
|
||||||
cm.addCategoryEntry(newCategory, key, val, false, false);
|
|
||||||
} else {
|
|
||||||
if (DEBUG) debug("disable: " + key);
|
|
||||||
cm.deleteCategoryEntry(newCategory, key, false);
|
|
||||||
}
|
|
||||||
} catch (ex) {
|
|
||||||
cm.deleteCategoryEntry(newCategory, key, false);
|
|
||||||
if (DEBUG) debug("no pref found: " + data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (topic) {
|
|
||||||
case 'app-startup':
|
|
||||||
enableAndAddObserver("JavaScript-navigator-property-maybe", "JavaScript-navigator-property");
|
|
||||||
enableAndAddObserver("JavaScript-global-constructor-maybe", "JavaScript-global-constructor");
|
|
||||||
break;
|
|
||||||
case 'nsPref:changed':
|
|
||||||
addOrRemoveCategory("JavaScript-navigator-property-maybe", "JavaScript-navigator-property");
|
|
||||||
addOrRemoveCategory("JavaScript-global-constructor-maybe", "JavaScript-global-constructor");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (DEBUG) debug("unknown topic: " + topic);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NavigatorPropertyHelper])
|
|
@ -1,3 +0,0 @@
|
|||||||
component {f0d03420-a0ce-11e2-9e96-0800200c9a66} NavigatorPropertyHelper.js
|
|
||||||
contract @mozilla.org/navigatorPropertyHelper;1 {f0d03420-a0ce-11e2-9e96-0800200c9a66}
|
|
||||||
category app-startup NavigatorPropertyHelper service,@mozilla.org/navigatorPropertyHelper;1
|
|
@ -263,8 +263,6 @@
|
|||||||
@BINPATH@/components/ConsoleAPI.js
|
@BINPATH@/components/ConsoleAPI.js
|
||||||
@BINPATH@/components/ContactManager.js
|
@BINPATH@/components/ContactManager.js
|
||||||
@BINPATH@/components/ContactManager.manifest
|
@BINPATH@/components/ContactManager.manifest
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.js
|
|
||||||
@BINPATH@/components/NavigatorPropertyHelper.manifest
|
|
||||||
@BINPATH@/components/SettingsManager.js
|
@BINPATH@/components/SettingsManager.js
|
||||||
@BINPATH@/components/SettingsManager.manifest
|
@BINPATH@/components/SettingsManager.manifest
|
||||||
@BINPATH@/components/SettingsService.js
|
@BINPATH@/components/SettingsService.js
|
||||||
|
Loading…
Reference in New Issue
Block a user