mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
[Pale-Moon] Issue MoonchildProductions/UXP#516 - Remove named function syntax from palemoon/components/feeds.
This commit is contained in:
parent
dd6ed2537f
commit
c7bcbe215d
4 changed files with 96 additions and 96 deletions
|
|
@ -127,7 +127,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIStreamConverter.idl
|
||||
*/
|
||||
convert: function FC_convert(sourceStream, sourceType, destinationType,
|
||||
convert: function (sourceStream, sourceType, destinationType,
|
||||
context) {
|
||||
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
|
||||
},
|
||||
|
|
@ -135,7 +135,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIStreamConverter.idl
|
||||
*/
|
||||
asyncConvertData: function FC_asyncConvertData(sourceType, destinationType,
|
||||
asyncConvertData: function (sourceType, destinationType,
|
||||
listener, context) {
|
||||
this._listener = listener;
|
||||
},
|
||||
|
|
@ -148,7 +148,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* Release our references to various things once we're done using them.
|
||||
*/
|
||||
_releaseHandles: function FC__releaseHandles() {
|
||||
_releaseHandles: function () {
|
||||
this._listener = null;
|
||||
this._request = null;
|
||||
this._processor = null;
|
||||
|
|
@ -157,7 +157,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIFeedResultListener.idl
|
||||
*/
|
||||
handleResult: function FC_handleResult(result) {
|
||||
handleResult: function (result) {
|
||||
// Feeds come in various content types, which our feed sniffer coerces to
|
||||
// the maybe.feed type. However, feeds are used as a transport for
|
||||
// different data types, e.g. news/blogs (traditional feed), video/audio
|
||||
|
|
@ -270,7 +270,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIStreamListener.idl
|
||||
*/
|
||||
onDataAvailable: function FC_onDataAvailable(request, context, inputStream,
|
||||
onDataAvailable: function (request, context, inputStream,
|
||||
sourceOffset, count) {
|
||||
if (this._processor)
|
||||
this._processor.onDataAvailable(request, context, inputStream,
|
||||
|
|
@ -280,7 +280,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIRequestObserver.idl
|
||||
*/
|
||||
onStartRequest: function FC_onStartRequest(request, context) {
|
||||
onStartRequest: function (request, context) {
|
||||
var channel = request.QueryInterface(Ci.nsIChannel);
|
||||
|
||||
// Check for a header that tells us there was no sniffing
|
||||
|
|
@ -323,7 +323,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsIRequestObserver.idl
|
||||
*/
|
||||
onStopRequest: function FC_onStopRequest(request, context, status) {
|
||||
onStopRequest: function (request, context, status) {
|
||||
if (this._processor)
|
||||
this._processor.onStopRequest(request, context, status);
|
||||
},
|
||||
|
|
@ -331,7 +331,7 @@ FeedConverter.prototype = {
|
|||
/**
|
||||
* See nsISupports.idl
|
||||
*/
|
||||
QueryInterface: function FC_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIFeedResultListener) ||
|
||||
iid.equals(Ci.nsIStreamConverter) ||
|
||||
iid.equals(Ci.nsIStreamListener) ||
|
||||
|
|
@ -366,7 +366,7 @@ FeedResultService.prototype = {
|
|||
/**
|
||||
* See nsIFeedResultService.idl
|
||||
*/
|
||||
addToClientReader: function FRS_addToClientReader(spec, title, subtitle, feedType) {
|
||||
addToClientReader: function (spec, title, subtitle, feedType) {
|
||||
var prefs =
|
||||
Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
|
@ -432,7 +432,7 @@ FeedResultService.prototype = {
|
|||
/**
|
||||
* See nsIFeedResultService.idl
|
||||
*/
|
||||
addFeedResult: function FRS_addFeedResult(feedResult) {
|
||||
addFeedResult: function (feedResult) {
|
||||
NS_ASSERT(feedResult.uri != null, "null URI!");
|
||||
NS_ASSERT(feedResult.uri != null, "null feedResult!");
|
||||
var spec = feedResult.uri.spec;
|
||||
|
|
@ -444,7 +444,7 @@ FeedResultService.prototype = {
|
|||
/**
|
||||
* See nsIFeedResultService.idl
|
||||
*/
|
||||
getFeedResult: function RFS_getFeedResult(uri) {
|
||||
getFeedResult: function (uri) {
|
||||
NS_ASSERT(uri != null, "null URI!");
|
||||
var resultList = this._results[uri.spec];
|
||||
for (var i in resultList) {
|
||||
|
|
@ -457,7 +457,7 @@ FeedResultService.prototype = {
|
|||
/**
|
||||
* See nsIFeedResultService.idl
|
||||
*/
|
||||
removeFeedResult: function FRS_removeFeedResult(uri) {
|
||||
removeFeedResult: function (uri) {
|
||||
NS_ASSERT(uri != null, "null URI!");
|
||||
var resultList = this._results[uri.spec];
|
||||
if (!resultList)
|
||||
|
|
@ -478,13 +478,13 @@ FeedResultService.prototype = {
|
|||
delete this._results[uri.spec];
|
||||
},
|
||||
|
||||
createInstance: function FRS_createInstance(outer, iid) {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return this.QueryInterface(iid);
|
||||
},
|
||||
|
||||
QueryInterface: function FRS_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIFeedResultService) ||
|
||||
iid.equals(Ci.nsIFactory) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
|
|
@ -500,7 +500,7 @@ FeedResultService.prototype = {
|
|||
function GenericProtocolHandler() {
|
||||
}
|
||||
GenericProtocolHandler.prototype = {
|
||||
_init: function GPH_init(scheme) {
|
||||
_init: function (scheme) {
|
||||
var ios =
|
||||
Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
|
@ -520,11 +520,11 @@ GenericProtocolHandler.prototype = {
|
|||
return this._http.defaultPort;
|
||||
},
|
||||
|
||||
allowPort: function GPH_allowPort(port, scheme) {
|
||||
allowPort: function (port, scheme) {
|
||||
return this._http.allowPort(port, scheme);
|
||||
},
|
||||
|
||||
newURI: function GPH_newURI(spec, originalCharset, baseURI) {
|
||||
newURI: function (spec, originalCharset, baseURI) {
|
||||
// Feed URIs can be either nested URIs of the form feed:realURI (in which
|
||||
// case we create a nested URI for the realURI) or feed://example.com, in
|
||||
// which case we create a nested URI for the real protocol which is http.
|
||||
|
|
@ -548,7 +548,7 @@ GenericProtocolHandler.prototype = {
|
|||
return uri;
|
||||
},
|
||||
|
||||
newChannel2: function GPH_newChannel(aUri, aLoadInfo) {
|
||||
newChannel2: function (aUri, aLoadInfo) {
|
||||
var inner = aUri.QueryInterface(Ci.nsINestedURI).innerURI;
|
||||
var channel = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
|
|
@ -562,7 +562,7 @@ GenericProtocolHandler.prototype = {
|
|||
},
|
||||
|
||||
|
||||
QueryInterface: function GPH_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIProtocolHandler) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@ FeedWriter.prototype = {
|
|||
_mimeSvc : Cc["@mozilla.org/mime;1"].
|
||||
getService(Ci.nsIMIMEService),
|
||||
|
||||
_getPropertyAsBag: function FW__getPropertyAsBag(container, property) {
|
||||
_getPropertyAsBag: function (container, property) {
|
||||
return container.fields.getProperty(property).
|
||||
QueryInterface(Ci.nsIPropertyBag2);
|
||||
},
|
||||
|
||||
_getPropertyAsString: function FW__getPropertyAsString(container, property) {
|
||||
_getPropertyAsString: function (container, property) {
|
||||
try {
|
||||
return container.fields.getPropertyAsAString(property);
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ FeedWriter.prototype = {
|
|||
return "";
|
||||
},
|
||||
|
||||
_setContentText: function FW__setContentText(id, text) {
|
||||
_setContentText: function (id, text) {
|
||||
this._contentSandbox.element = this._document.getElementById(id);
|
||||
this._contentSandbox.textNode = text.createDocumentFragment(this._contentSandbox.element);
|
||||
var codeStr =
|
||||
|
|
@ -190,7 +190,7 @@ FeedWriter.prototype = {
|
|||
* The URI spec to set as the href
|
||||
*/
|
||||
_safeSetURIAttribute:
|
||||
function FW__safeSetURIAttribute(element, attribute, uri) {
|
||||
function (element, attribute, uri) {
|
||||
var secman = Cc["@mozilla.org/scriptsecuritymanager;1"].
|
||||
getService(Ci.nsIScriptSecurityManager);
|
||||
const flags = Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL;
|
||||
|
|
@ -243,7 +243,7 @@ FeedWriter.prototype = {
|
|||
* @param aElement
|
||||
* the XUL element to call doCommand() on.
|
||||
*/
|
||||
_safeDoCommand: function FW___safeDoCommand(aElement) {
|
||||
_safeDoCommand: function (aElement) {
|
||||
this._contentSandbox.element = aElement;
|
||||
Cu.evalInSandbox("element.doCommand();", this._contentSandbox);
|
||||
this._contentSandbox.element = null;
|
||||
|
|
@ -268,16 +268,16 @@ FeedWriter.prototype = {
|
|||
return this.__bundle;
|
||||
},
|
||||
|
||||
_getFormattedString: function FW__getFormattedString(key, params) {
|
||||
_getFormattedString: function (key, params) {
|
||||
return this._bundle.formatStringFromName(key, params, params.length);
|
||||
},
|
||||
|
||||
_getString: function FW__getString(key) {
|
||||
_getString: function (key) {
|
||||
return this._bundle.GetStringFromName(key);
|
||||
},
|
||||
|
||||
/* Magic helper methods to be used instead of xbl properties */
|
||||
_getSelectedItemFromMenulist: function FW__getSelectedItemFromList(aList) {
|
||||
_getSelectedItemFromMenulist: function (aList) {
|
||||
var node = aList.firstChild.firstChild;
|
||||
while (node) {
|
||||
if (node.localName == "menuitem" && node.getAttribute("selected") == "true")
|
||||
|
|
@ -289,7 +289,7 @@ FeedWriter.prototype = {
|
|||
return null;
|
||||
},
|
||||
|
||||
_setCheckboxCheckedState: function FW__setCheckboxCheckedState(aCheckbox, aValue) {
|
||||
_setCheckboxCheckedState: function (aCheckbox, aValue) {
|
||||
// see checkbox.xml, xbl bindings are not applied within the sandbox!
|
||||
this._contentSandbox.checkbox = aCheckbox;
|
||||
var codeStr;
|
||||
|
|
@ -315,7 +315,7 @@ FeedWriter.prototype = {
|
|||
* @param dateString
|
||||
* A date as extracted from a feed entry. (entry.updated)
|
||||
*/
|
||||
_parseDate: function FW__parseDate(dateString) {
|
||||
_parseDate: function (dateString) {
|
||||
// Convert the date into the user's local time zone
|
||||
dateObj = new Date(dateString);
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ FeedWriter.prototype = {
|
|||
* Returns the feed type.
|
||||
*/
|
||||
__feedType: null,
|
||||
_getFeedType: function FW__getFeedType() {
|
||||
_getFeedType: function () {
|
||||
if (this.__feedType != null)
|
||||
return this.__feedType;
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ FeedWriter.prototype = {
|
|||
/**
|
||||
* Maps a feed type to a maybe-feed mimetype.
|
||||
*/
|
||||
_getMimeTypeForFeedType: function FW__getMimeTypeForFeedType() {
|
||||
_getMimeTypeForFeedType: function () {
|
||||
switch (this._getFeedType()) {
|
||||
case Ci.nsIFeed.TYPE_VIDEO:
|
||||
return TYPE_MAYBE_VIDEO_FEED;
|
||||
|
|
@ -370,7 +370,7 @@ FeedWriter.prototype = {
|
|||
* @param container
|
||||
* The feed container
|
||||
*/
|
||||
_setTitleText: function FW__setTitleText(container) {
|
||||
_setTitleText: function (container) {
|
||||
if (container.title) {
|
||||
var title = container.title.plainText();
|
||||
this._setContentText(TITLE_ID, container.title);
|
||||
|
|
@ -390,7 +390,7 @@ FeedWriter.prototype = {
|
|||
* @param container
|
||||
* The feed container
|
||||
*/
|
||||
_setTitleImage: function FW__setTitleImage(container) {
|
||||
_setTitleImage: function (container) {
|
||||
try {
|
||||
var parts = container.image;
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ FeedWriter.prototype = {
|
|||
* @param container
|
||||
* The container of entries in the feed
|
||||
*/
|
||||
_writeFeedContent: function FW__writeFeedContent(container) {
|
||||
_writeFeedContent: function (container) {
|
||||
// Build the actual feed content
|
||||
var feed = container.QueryInterface(Ci.nsIFeed);
|
||||
if (feed.items.length == 0)
|
||||
|
|
@ -532,7 +532,7 @@ FeedWriter.prototype = {
|
|||
* The URL string from which to create a display name
|
||||
* @returns a string
|
||||
*/
|
||||
_getURLDisplayName: function FW__getURLDisplayName(aURL) {
|
||||
_getURLDisplayName: function (aURL) {
|
||||
var url = makeURI(aURL);
|
||||
url.QueryInterface(Ci.nsIURL);
|
||||
if (url == null || url.fileName.length == 0)
|
||||
|
|
@ -548,7 +548,7 @@ FeedWriter.prototype = {
|
|||
* FeedEntry with enclosures
|
||||
* @returns element
|
||||
*/
|
||||
_buildEnclosureDiv: function FW__buildEnclosureDiv(entry) {
|
||||
_buildEnclosureDiv: function (entry) {
|
||||
var enclosuresDiv = this._document.createElementNS(HTML_NS, "div");
|
||||
enclosuresDiv.className = "enclosures";
|
||||
|
||||
|
|
@ -628,7 +628,7 @@ FeedWriter.prototype = {
|
|||
* @returns A valid nsIFeedContainer object containing the contents of
|
||||
* the feed.
|
||||
*/
|
||||
_getContainer: function FW__getContainer(result) {
|
||||
_getContainer: function (result) {
|
||||
var feedService =
|
||||
Cc["@mozilla.org/browser/feeds/result-service;1"].
|
||||
getService(Ci.nsIFeedResultService);
|
||||
|
|
@ -668,7 +668,7 @@ FeedWriter.prototype = {
|
|||
* A nsIFile to look up the name of
|
||||
* @returns The display name of the application represented by the file.
|
||||
*/
|
||||
_getFileDisplayName: function FW__getFileDisplayName(file) {
|
||||
_getFileDisplayName: function (file) {
|
||||
#ifdef XP_WIN
|
||||
if (file instanceof Ci.nsILocalFileWin) {
|
||||
try {
|
||||
|
|
@ -710,7 +710,7 @@ FeedWriter.prototype = {
|
|||
* Helper method to get an element in the XBL binding where the handler
|
||||
* selection UI lives
|
||||
*/
|
||||
_getUIElement: function FW__getUIElement(id) {
|
||||
_getUIElement: function (id) {
|
||||
return this._document.getAnonymousElementByAttribute(
|
||||
this._document.getElementById("feedSubscribeLine"), "anonid", id);
|
||||
},
|
||||
|
|
@ -720,7 +720,7 @@ FeedWriter.prototype = {
|
|||
* @param aCallback the callback method, passes in true if a feed reader was
|
||||
* selected, false otherwise.
|
||||
*/
|
||||
_chooseClientApp: function FW__chooseClientApp(aCallback) {
|
||||
_chooseClientApp: function (aCallback) {
|
||||
try {
|
||||
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
let fpCallback = function fpCallback_done(aResult) {
|
||||
|
|
@ -766,7 +766,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_setAlwaysUseCheckedState: function FW__setAlwaysUseCheckedState(feedType) {
|
||||
_setAlwaysUseCheckedState: function (feedType) {
|
||||
var checkbox = this._getUIElement("alwaysUse");
|
||||
if (checkbox) {
|
||||
var alwaysUse = false;
|
||||
|
|
@ -781,7 +781,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_setSubscribeUsingLabel: function FW__setSubscribeUsingLabel() {
|
||||
_setSubscribeUsingLabel: function () {
|
||||
var stringLabel = "subscribeFeedUsing";
|
||||
switch (this._getFeedType()) {
|
||||
case Ci.nsIFeed.TYPE_VIDEO:
|
||||
|
|
@ -800,7 +800,7 @@ FeedWriter.prototype = {
|
|||
Cu.evalInSandbox(codeStr, this._contentSandbox);
|
||||
},
|
||||
|
||||
_setAlwaysUseLabel: function FW__setAlwaysUseLabel() {
|
||||
_setAlwaysUseLabel: function () {
|
||||
var checkbox = this._getUIElement("alwaysUse");
|
||||
if (checkbox) {
|
||||
if (this._handlersMenuList) {
|
||||
|
|
@ -864,7 +864,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_setSelectedHandler: function FW__setSelectedHandler(feedType) {
|
||||
_setSelectedHandler: function (feedType) {
|
||||
var prefs =
|
||||
Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
|
@ -927,7 +927,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_initSubscriptionUI: function FW__initSubscriptionUI() {
|
||||
_initSubscriptionUI: function () {
|
||||
var handlersMenuPopup = this._getUIElement("handlersMenuPopup");
|
||||
if (!handlersMenuPopup)
|
||||
return;
|
||||
|
|
@ -1105,7 +1105,7 @@ FeedWriter.prototype = {
|
|||
* @param aWindow
|
||||
* The window of the document invoking the BrowserFeedWriter
|
||||
*/
|
||||
_getOriginalURI: function FW__getOriginalURI(aWindow) {
|
||||
_getOriginalURI: function (aWindow) {
|
||||
var chan = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIWebNavigation).
|
||||
QueryInterface(Ci.nsIDocShell).currentDocumentChannel;
|
||||
|
|
@ -1135,7 +1135,7 @@ FeedWriter.prototype = {
|
|||
_handlersMenuList: null,
|
||||
|
||||
// BrowserFeedWriter WebIDL methods
|
||||
init: function FW_init(aWindow) {
|
||||
init: function (aWindow) {
|
||||
var window = aWindow;
|
||||
this._feedURI = this._getOriginalURI(window);
|
||||
if (!this._feedURI)
|
||||
|
|
@ -1171,7 +1171,7 @@ FeedWriter.prototype = {
|
|||
prefs.addObserver(PREF_AUDIO_SELECTED_APP, this, false);
|
||||
},
|
||||
|
||||
writeContent: function FW_writeContent() {
|
||||
writeContent: function () {
|
||||
if (!this._window)
|
||||
return;
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
close: function FW_close() {
|
||||
close: function () {
|
||||
this._getUIElement("handlersMenuPopup")
|
||||
.removeEventListener("command", this, false);
|
||||
this._getUIElement("subscribeButton")
|
||||
|
|
@ -1220,7 +1220,7 @@ FeedWriter.prototype = {
|
|||
this.__contentSandbox = null;
|
||||
},
|
||||
|
||||
_removeFeedFromCache: function FW__removeFeedFromCache() {
|
||||
_removeFeedFromCache: function () {
|
||||
if (this._feedURI) {
|
||||
var feedService = Cc["@mozilla.org/browser/feeds/result-service;1"].
|
||||
getService(Ci.nsIFeedResultService);
|
||||
|
|
@ -1229,7 +1229,7 @@ FeedWriter.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
subscribe: function FW_subscribe() {
|
||||
subscribe: function () {
|
||||
var feedType = this._getFeedType();
|
||||
|
||||
// Subscribe to the feed using the selected handler and save prefs
|
||||
|
|
@ -1313,7 +1313,7 @@ FeedWriter.prototype = {
|
|||
},
|
||||
|
||||
// nsIObserver
|
||||
observe: function FW_observe(subject, topic, data) {
|
||||
observe: function (subject, topic, data) {
|
||||
if (!this._window) {
|
||||
// this._window is null unless this.init was called with a trusted
|
||||
// window object.
|
||||
|
|
@ -1356,7 +1356,7 @@ FeedWriter.prototype = {
|
|||
* to the icon url. See Bug 358878 for details.
|
||||
*/
|
||||
_setFaviconForWebReader:
|
||||
function FW__setFaviconForWebReader(aReaderUrl, aMenuItem) {
|
||||
function (aReaderUrl, aMenuItem) {
|
||||
var readerURI = makeURI(aReaderUrl);
|
||||
if (!/^https?$/.test(readerURI.scheme)) {
|
||||
// Don't try to get a favicon for non http(s) URIs.
|
||||
|
|
|
|||
|
|
@ -73,19 +73,19 @@ const NS_ERROR_DOM_SYNTAX_ERR = NS_ERROR_MODULE_DOM + 12;
|
|||
function WebContentConverter() {
|
||||
}
|
||||
WebContentConverter.prototype = {
|
||||
convert: function WCC_convert() { },
|
||||
asyncConvertData: function WCC_asyncConvertData() { },
|
||||
onDataAvailable: function WCC_onDataAvailable() { },
|
||||
onStopRequest: function WCC_onStopRequest() { },
|
||||
convert: function () { },
|
||||
asyncConvertData: function () { },
|
||||
onDataAvailable: function () { },
|
||||
onStopRequest: function () { },
|
||||
|
||||
onStartRequest: function WCC_onStartRequest(request, context) {
|
||||
onStartRequest: function (request, context) {
|
||||
var wccr =
|
||||
Cc[WCCR_CONTRACTID].
|
||||
getService(Ci.nsIWebContentConverterService);
|
||||
wccr.loadPreferredHandler(request);
|
||||
},
|
||||
|
||||
QueryInterface: function WCC_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIStreamConverter) ||
|
||||
iid.equals(Ci.nsIStreamListener) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
|
|
@ -95,13 +95,13 @@ WebContentConverter.prototype = {
|
|||
};
|
||||
|
||||
var WebContentConverterFactory = {
|
||||
createInstance: function WCCF_createInstance(outer, iid) {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return new WebContentConverter().QueryInterface(iid);
|
||||
},
|
||||
|
||||
QueryInterface: function WCC_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIFactory) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
return this;
|
||||
|
|
@ -125,7 +125,7 @@ ServiceInfo.prototype = {
|
|||
/**
|
||||
* See nsIHandlerApp
|
||||
*/
|
||||
equals: function SI_equals(aHandlerApp) {
|
||||
equals: function (aHandlerApp) {
|
||||
if (!aHandlerApp)
|
||||
throw Cr.NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
|
@ -154,11 +154,11 @@ ServiceInfo.prototype = {
|
|||
/**
|
||||
* See nsIWebContentHandlerInfo
|
||||
*/
|
||||
getHandlerURI: function SI_getHandlerURI(uri) {
|
||||
getHandlerURI: function (uri) {
|
||||
return this._uri.replace(/%s/gi, encodeURIComponent(uri));
|
||||
},
|
||||
|
||||
QueryInterface: function SI_QueryInterface(iid) {
|
||||
QueryInterface: function (iid) {
|
||||
if (iid.equals(Ci.nsIWebContentHandlerInfo) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
return this;
|
||||
|
|
@ -180,11 +180,11 @@ WebContentConverterRegistrar.prototype = {
|
|||
return WebContentConverterRegistrar.prototype.stringBundle = sb;
|
||||
},
|
||||
|
||||
_getFormattedString: function WCCR__getFormattedString(key, params) {
|
||||
_getFormattedString: function (key, params) {
|
||||
return this.stringBundle.formatStringFromName(key, params, params.length);
|
||||
},
|
||||
|
||||
_getString: function WCCR_getString(key) {
|
||||
_getString: function (key) {
|
||||
return this.stringBundle.GetStringFromName(key);
|
||||
},
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
getAutoHandler:
|
||||
function WCCR_getAutoHandler(contentType) {
|
||||
function (contentType) {
|
||||
contentType = this._resolveContentType(contentType);
|
||||
if (contentType in this._autoHandleContentTypes)
|
||||
return this._autoHandleContentTypes[contentType];
|
||||
|
|
@ -203,7 +203,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
setAutoHandler:
|
||||
function WCCR_setAutoHandler(contentType, handler) {
|
||||
function (contentType, handler) {
|
||||
if (handler && !this._typeIsRegistered(contentType, handler.uri))
|
||||
throw Cr.NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* Update the internal data structure (not persistent)
|
||||
*/
|
||||
_setAutoHandler:
|
||||
function WCCR__setAutoHandler(contentType, handler) {
|
||||
function (contentType, handler) {
|
||||
if (handler)
|
||||
this._autoHandleContentTypes[contentType] = handler;
|
||||
else if (contentType in this._autoHandleContentTypes)
|
||||
|
|
@ -237,7 +237,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
getWebContentHandlerByURI:
|
||||
function WCCR_getWebContentHandlerByURI(contentType, uri) {
|
||||
function (contentType, uri) {
|
||||
var handlers = this.getContentHandlers(contentType, { });
|
||||
for (var i = 0; i < handlers.length; ++i) {
|
||||
if (handlers[i].uri == uri)
|
||||
|
|
@ -250,7 +250,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
loadPreferredHandler:
|
||||
function WCCR_loadPreferredHandler(request) {
|
||||
function (request) {
|
||||
var channel = request.QueryInterface(Ci.nsIChannel);
|
||||
var contentType = this._resolveContentType(channel.contentType);
|
||||
var handler = this.getAutoHandler(contentType);
|
||||
|
|
@ -269,7 +269,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
removeProtocolHandler:
|
||||
function WCCR_removeProtocolHandler(aProtocol, aURITemplate) {
|
||||
function (aProtocol, aURITemplate) {
|
||||
var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
|
||||
getService(Ci.nsIExternalProtocolService);
|
||||
var handlerInfo = eps.getProtocolHandlerInfo(aProtocol);
|
||||
|
|
@ -292,7 +292,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
removeContentHandler:
|
||||
function WCCR_removeContentHandler(contentType, uri) {
|
||||
function (contentType, uri) {
|
||||
function notURI(serviceInfo) {
|
||||
return serviceInfo.uri != uri;
|
||||
}
|
||||
|
|
@ -326,7 +326,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* @returns The resolved contentType value.
|
||||
*/
|
||||
_resolveContentType:
|
||||
function WCCR__resolveContentType(contentType) {
|
||||
function (contentType) {
|
||||
if (contentType in this._mappings)
|
||||
return this._mappings[contentType];
|
||||
return contentType;
|
||||
|
|
@ -339,7 +339,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
},
|
||||
|
||||
_checkAndGetURI:
|
||||
function WCCR_checkAndGetURI(aURIString, aContentWindow)
|
||||
function (aURIString, aContentWindow)
|
||||
{
|
||||
try {
|
||||
let baseURI = aContentWindow.document.baseURIObject;
|
||||
|
|
@ -382,7 +382,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* @return true if it is already registered, false otherwise.
|
||||
*/
|
||||
_protocolHandlerRegistered:
|
||||
function WCCR_protocolHandlerRegistered(aProtocol, aURITemplate) {
|
||||
function (aProtocol, aURITemplate) {
|
||||
var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
|
||||
getService(Ci.nsIExternalProtocolService);
|
||||
var handlerInfo = eps.getProtocolHandlerInfo(aProtocol);
|
||||
|
|
@ -401,7 +401,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentHandlerRegistrar
|
||||
*/
|
||||
registerProtocolHandler:
|
||||
function WCCR_registerProtocolHandler(aProtocol, aURIString, aTitle, aContentWindow) {
|
||||
function (aProtocol, aURIString, aTitle, aContentWindow) {
|
||||
LOG("registerProtocolHandler(" + aProtocol + "," + aURIString + "," + aTitle + ")");
|
||||
|
||||
var uri = this._checkAndGetURI(aURIString, aContentWindow);
|
||||
|
|
@ -455,7 +455,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
protocolInfo: { protocol: aProtocol, uri: uri.spec, name: aTitle },
|
||||
|
||||
callback:
|
||||
function WCCR_addProtocolHandlerButtonCallback(aNotification, aButtonInfo) {
|
||||
function (aNotification, aButtonInfo) {
|
||||
var protocol = aButtonInfo.protocolInfo.protocol;
|
||||
var uri = aButtonInfo.protocolInfo.uri;
|
||||
var name = aButtonInfo.protocolInfo.name;
|
||||
|
|
@ -496,7 +496,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* prompt the user to confirm the registration.
|
||||
*/
|
||||
registerContentHandler:
|
||||
function WCCR_registerContentHandler(aContentType, aURIString, aTitle, aContentWindow) {
|
||||
function (aContentType, aURIString, aTitle, aContentWindow) {
|
||||
LOG("registerContentHandler(" + aContentType + "," + aURIString + "," + aTitle + ")");
|
||||
|
||||
// Check against the type blacklist.
|
||||
|
|
@ -526,7 +526,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* Returns the browser chrome window in which the content window is in
|
||||
*/
|
||||
_getBrowserWindowForContentWindow:
|
||||
function WCCR__getBrowserWindowForContentWindow(aContentWindow) {
|
||||
function (aContentWindow) {
|
||||
return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
|
|
@ -547,7 +547,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* (i.e. the content window of a frame/iframe).
|
||||
*/
|
||||
_getBrowserForContentWindow:
|
||||
function WCCR__getBrowserForContentWindow(aBrowserWindow, aContentWindow) {
|
||||
function (aBrowserWindow, aContentWindow) {
|
||||
// This depends on pseudo APIs of browser.js and tabbrowser.xml
|
||||
aContentWindow = aContentWindow.top;
|
||||
var browsers = aBrowserWindow.gBrowser.browsers;
|
||||
|
|
@ -579,7 +579,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* @return true if a notification has been appended, false otherwise.
|
||||
*/
|
||||
_appendFeedReaderNotification:
|
||||
function WCCR__appendFeedReaderNotification(aURI, aName, aNotificationBox) {
|
||||
function (aURI, aName, aNotificationBox) {
|
||||
var uriSpec = aURI.spec;
|
||||
var notificationValue = "feed reader notification: " + uriSpec;
|
||||
var notificationIcon = aURI.prePath + "/favicon.ico";
|
||||
|
|
@ -603,7 +603,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
|
||||
/* static */
|
||||
callback:
|
||||
function WCCR__addFeedReaderButtonCallback(aNotification, aButtonInfo) {
|
||||
function (aNotification, aButtonInfo) {
|
||||
var uri = aButtonInfo.feedReaderInfo.uri;
|
||||
var name = aButtonInfo.feedReaderInfo.name;
|
||||
var outer = aButtonInfo._outer;
|
||||
|
|
@ -645,7 +645,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* browser.contentHandlers.title0 = Foo 2.0alphr
|
||||
*/
|
||||
_saveContentHandlerToPrefs:
|
||||
function WCCR__saveContentHandlerToPrefs(contentType, uri, title) {
|
||||
function (contentType, uri, title) {
|
||||
var ps =
|
||||
Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefService);
|
||||
|
|
@ -685,7 +685,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* @param uri
|
||||
* The uri of the
|
||||
*/
|
||||
_typeIsRegistered: function WCCR__typeIsRegistered(contentType, uri) {
|
||||
_typeIsRegistered: function (contentType, uri) {
|
||||
if (!(contentType in this._contentTypes))
|
||||
return false;
|
||||
|
||||
|
|
@ -705,7 +705,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* @returns A contract id to construct a converter to convert between the
|
||||
* contentType and *\/*.
|
||||
*/
|
||||
_getConverterContractID: function WCCR__getConverterContractID(contentType) {
|
||||
_getConverterContractID: function (contentType) {
|
||||
const template = "@mozilla.org/streamconv;1?from=%s&to=*/*";
|
||||
return template.replace(/%s/, contentType);
|
||||
},
|
||||
|
|
@ -721,7 +721,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* the human readable name of the web service
|
||||
*/
|
||||
_registerContentHandler:
|
||||
function WCCR__registerContentHandler(contentType, uri, title) {
|
||||
function (contentType, uri, title) {
|
||||
this._updateContentTypeHandlerMap(contentType, uri, title);
|
||||
this._saveContentHandlerToPrefs(contentType, uri, title);
|
||||
|
||||
|
|
@ -754,7 +754,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* The human readable name of the web service
|
||||
*/
|
||||
_updateContentTypeHandlerMap:
|
||||
function WCCR__updateContentTypeHandlerMap(contentType, uri, title) {
|
||||
function (contentType, uri, title) {
|
||||
if (!(contentType in this._contentTypes))
|
||||
this._contentTypes[contentType] = [];
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
getContentHandlers:
|
||||
function WCCR_getContentHandlers(contentType, countRef) {
|
||||
function (contentType, countRef) {
|
||||
countRef.value = 0;
|
||||
if (!(contentType in this._contentTypes))
|
||||
return [];
|
||||
|
|
@ -790,7 +790,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* See nsIWebContentConverterService
|
||||
*/
|
||||
resetHandlersForType:
|
||||
function WCCR_resetHandlersForType(contentType) {
|
||||
function (contentType) {
|
||||
// currently unused within the tree, so only useful for extensions; previous
|
||||
// impl. was buggy (and even infinite-looped!), so I argue that this is a
|
||||
// definite improvement
|
||||
|
|
@ -833,7 +833,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
* Load the auto handler, content handler and protocol tables from
|
||||
* preferences.
|
||||
*/
|
||||
_init: function WCCR__init() {
|
||||
_init: function () {
|
||||
var ps =
|
||||
Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefService);
|
||||
|
|
@ -883,7 +883,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
/**
|
||||
* See nsIObserver
|
||||
*/
|
||||
observe: function WCCR_observe(subject, topic, data) {
|
||||
observe: function (subject, topic, data) {
|
||||
var os =
|
||||
Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
|
|
@ -901,7 +901,7 @@ WebContentConverterRegistrar.prototype = {
|
|||
/**
|
||||
* See nsIFactory
|
||||
*/
|
||||
createInstance: function WCCR_createInstance(outer, iid) {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return this.QueryInterface(iid);
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ var SubscribeHandler = {
|
|||
*/
|
||||
_feedWriter: null,
|
||||
|
||||
init: function SH_init() {
|
||||
init: function () {
|
||||
this._feedWriter = new BrowserFeedWriter();
|
||||
},
|
||||
|
||||
writeContent: function SH_writeContent() {
|
||||
writeContent: function () {
|
||||
this._feedWriter.writeContent();
|
||||
},
|
||||
|
||||
uninit: function SH_uninit() {
|
||||
uninit: function () {
|
||||
this._feedWriter.close();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue