~ubuntu-branches/ubuntu/precise/ubufox/precise-security

« back to all changes in this revision

Viewing changes to modules/PluginProviderPFS.jsm

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-06-27 20:20:25 UTC
  • mfrom: (1.2.3) (65.1.1 precise-proposed)
  • Revision ID: package-import@ubuntu.com-20120627202025-6xs4hfyv2u8n0pmj
Tags: 2.1.1-0ubuntu0.12.04.1
* New upstream release v2.1.1
  - Drop the alternative plugin selector, as it depends on a patch that
    we no longer carry in Firefox

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
var EXPORTED_SYMBOLS = [ ];
58
58
 
59
59
Cu.import("resource://ubufox/PluginFinder.jsm");
 
60
Cu.import("resource://ubufox/Distro.jsm");
60
61
Cu.import("resource://gre/modules/Services.jsm");
61
62
 
62
63
["LOG", "WARN", "ERROR"].forEach(function(aName) {
91
92
};
92
93
 
93
94
var PluginProviderPFS = {
94
 
  get pfsURI() {
95
 
    return Services.prefs.getCharPref("pfs.datasource.url");
96
 
    //return "http://localhost/~chr1s/cgi-bin/plugin-finder.py?mimetype=%PLUGIN_MIMETYPE%&appID=%APP_ID%&appVersion=%APP_VERSION%&clientOS=%CLIENT_OS%&chromeLocale=%CHROME_LOCALE%&distributionID=%DIST_ID%";
97
 
  },
98
 
 
99
95
  get clientOS() {
100
96
    if (!this._clientOS) {
101
97
      this._clientOS = Cc["@mozilla.org/network/protocol;1?name=http"]
115
111
    return this._chromeLocale;
116
112
  },
117
113
 
118
 
  get distID() {
119
 
    if (!this._distID) {
120
 
      this._distID = Services.prefs.getCharPref("extensions.ubufox.release");
121
 
    }
122
 
 
123
 
    return this._distID;
124
 
  },
125
 
 
126
114
  get rdfService() {
127
115
    if (!this._rdfService) {
128
116
      this._rdfService = Cc["@mozilla.org/rdf/rdf-service;1"].getService(nsIRDFService);
133
121
 
134
122
  getPluginInfo: function PPPFS_getPluginInfo(aMimeType, aListener) {
135
123
    LOG("Handling getPluginInfo for " + aMimeType);
136
 
    let uri = this.pfsURI;
 
124
    let uri;
 
125
    try {
 
126
      uri = Services.prefs.getCharPref("extensions.ubufox.plugin-finder.pfsurl");
 
127
    } catch(e) {
 
128
      uri = distro.PFSURI;
 
129
    }
 
130
    if (!uri) {
 
131
      this.onDataSourceError("No PFS URL", aMimeType, aListener);
 
132
      return;
 
133
    }
137
134
 
138
135
    uri = uri.replace(/%PLUGIN_MIMETYPE%/g, encodeURIComponent(aMimeType));
139
136
    uri = uri.replace(/%APP_ID%/g, Services.appinfo.ID);
141
138
    uri = uri.replace(/%APP_RELEASE%/g, Services.appinfo.version);
142
139
    uri = uri.replace(/%CLIENT_OS%/g, this.clientOS);
143
140
    uri = uri.replace(/%CHROME_LOCALE%/g, this.chromeLocale);
144
 
    uri = uri.replace(/%DIST_ID%/g, this.distID);
145
141
 
146
142
    LOG("uri = " + uri);
147
143
    let ds = this.rdfService.GetDataSource(uri);