File: scriptResource.js

package info (click to toggle)
greasemonkey 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,820 kB
  • sloc: xml: 171; makefile: 10
file content (19 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var EXPORTED_SYMBOLS = ['ScriptResource'];

Components.utils.import('resource://greasemonkey/scriptDependency.js');
Components.utils.import('resource://greasemonkey/util.js');

ScriptResource.prototype = new ScriptDependency();
ScriptResource.prototype.constructor = ScriptResource;
function ScriptResource(aScript) {
  ScriptDependency.call(this, aScript);
  this.type = 'ScriptResource';
}

ScriptResource.prototype.__defineGetter__('dataContent',
function ScriptResource_getDataContent() {
  var binaryContents = GM_util.getBinaryContents(this.file);

  return 'data:' + this.mimetype
      + ';base64,' + encodeURIComponent(btoa(binaryContents));
});