/usr/share/xul-ext/greasemonkey/modules/scriptIcon.js is in xul-ext-greasemonkey 3.8-1~deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | var EXPORTED_SYMBOLS = ['ScriptIcon'];
Components.utils.import('chrome://greasemonkey-modules/content/scriptDependency.js');
Components.utils.import('chrome://greasemonkey-modules/content/util.js');
var stringBundle = Components
.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService)
.createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
ScriptIcon.prototype = new ScriptDependency();
ScriptIcon.prototype.constructor = ScriptIcon;
function ScriptIcon(aScript) {
ScriptDependency.call(this, aScript);
this.type = 'ScriptIcon';
}
ScriptIcon.prototype.__defineGetter__('fileURL',
function ScriptIcon_getFileURL() {
if (this._dataURI) {
return this._dataURI;
} else if (this._filename) {
return GM_util.getUriFromFile(this.file).spec;
} else {
return 'chrome://greasemonkey/skin/userscript.png';
}
});
ScriptIcon.prototype.__defineSetter__('fileURL',
function ScriptIcon_setFileURL(iconURL) {
if (/^data:/i.test(iconURL)) {
// icon is a data scheme
this._dataURI = iconURL;
} else if (iconURL) {
// icon is a file
this._filename = iconURL;
}
});
ScriptIcon.prototype.setMetaVal = function(value) {
// accept data uri schemes for image mime types
if (/^data:image\//i.test(value)) {
this._dataURI = value;
} else if (/^data:/i.test(value)) {
throw new Error(stringBundle.GetStringFromName('icon.uri-image-type'));
} else {
var resUri = GM_util.uriFromUrl(this._script._downloadURL);
this._downloadURL = GM_util.uriFromUrl(value, resUri).spec;
}
};
|