mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
[PALEMOON] Use generic application icon for external applications in about:feeds
This commit is contained in:
parent
dfcf00a75f
commit
79acd8acd5
1 changed files with 4 additions and 16 deletions
|
|
@ -691,21 +691,6 @@ FeedWriter.prototype = {
|
|||
return file.leafName;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get moz-icon url for a file
|
||||
* @param file
|
||||
* A nsIFile object for which the moz-icon:// is returned
|
||||
* @returns moz-icon url of the given file as a string
|
||||
*/
|
||||
_getFileIconURL: function FW__getFileIconURL(file) {
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var fph = ios.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
var urlSpec = fph.getURLSpecFromFile(file);
|
||||
return "moz-icon://" + urlSpec + "?size=16";
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper method to set the selected application and system default
|
||||
* reader menuitems details from a file object
|
||||
|
|
@ -717,7 +702,10 @@ FeedWriter.prototype = {
|
|||
_initMenuItemWithFile: function(aMenuItem, aFile) {
|
||||
this._contentSandbox.menuitem = aMenuItem;
|
||||
this._contentSandbox.label = this._getFileDisplayName(aFile);
|
||||
this._contentSandbox.image = this._getFileIconURL(aFile);
|
||||
// For security reasons, access to moz-icon:file://... URIs is
|
||||
// no longer allowed (indirect file system access from content).
|
||||
// We use a dummy application instead to get a generic icon.
|
||||
this._contentSandbox.image = "moz-icon://dummy.exe?size=16";
|
||||
var codeStr = "menuitem.setAttribute('label', label); " +
|
||||
"menuitem.setAttribute('image', image);"
|
||||
Cu.evalInSandbox(codeStr, this._contentSandbox);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue