Skip to content

Commit bf64240

Browse files
committed
SeaMonkey support without SMILE
1 parent 4583221 commit bf64240

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

extensions/firefox/components/PdfStreamConverter.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,25 @@ const PDFJS_EVENT_ID = 'pdf.js.message';
1313
const PDF_CONTENT_TYPE = 'application/pdf';
1414
const EXT_PREFIX = 'extensions.uriloader@pdf.js';
1515
const MAX_DATABASE_LENGTH = 4096;
16+
const FIREFOX_ID = '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}';
17+
const SEAMONKEY_ID = '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}';
1618

1719
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
1820
Cu.import('resource://gre/modules/Services.jsm');
1921
Cu.import('resource://gre/modules/NetUtil.jsm');
2022

21-
let privateBrowsing = Cc['@mozilla.org/privatebrowsing;1']
22-
.getService(Ci.nsIPrivateBrowsingService);
23-
let inPrivateBrowswing = privateBrowsing.privateBrowsingEnabled;
23+
let appInfo = Cc['@mozilla.org/xre/app-info;1']
24+
.getService(Ci.nsIXULAppInfo);
25+
let privateBrowsing, inPrivateBrowsing;
26+
27+
if (appInfo.ID === FIREFOX_ID) {
28+
privateBrowsing = Cc['@mozilla.org/privatebrowsing;1']
29+
.getService(Ci.nsIPrivateBrowsingService);
30+
inPrivateBrowsing = privateBrowsing.privateBrowsingEnabled;
31+
} else if (appInfo.ID === SEAMONKEY_ID) {
32+
privateBrowsing = null;
33+
inPrivateBrowsing = false;
34+
}
2435

2536
function getBoolPref(pref, def) {
2637
try {
@@ -61,8 +72,8 @@ function getDOMWindow(aChannel) {
6172

6273
// All the priviledged actions.
6374
function ChromeActions() {
64-
this.inPrivateBrowswing = privateBrowsing.privateBrowsingEnabled;
6575
}
76+
6677
ChromeActions.prototype = {
6778
download: function(data) {
6879
let mimeService = Cc['@mozilla.org/mime;1'].getService(Ci.nsIMIMEService);
@@ -98,15 +109,15 @@ ChromeActions.prototype = {
98109
channel.asyncOpen(listener, null);
99110
},
100111
setDatabase: function(data) {
101-
if (this.inPrivateBrowswing)
112+
if (inPrivateBrowsing)
102113
return;
103114
// Protect against something sending tons of data to setDatabase.
104115
if (data.length > MAX_DATABASE_LENGTH)
105116
return;
106117
setStringPref(EXT_PREFIX + '.database', data);
107118
},
108119
getDatabase: function() {
109-
if (this.inPrivateBrowswing)
120+
if (inPrivateBrowsing)
110121
return '{}';
111122
return getStringPref(EXT_PREFIX + '.database', '{}');
112123
},

extensions/firefox/install.rdf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,24 @@
88
<!-- PDFJS_LOCALIZED_METADATA -->
99
<em:name>PDF Viewer</em:name>
1010
<em:version>PDFJSSCRIPT_VERSION</em:version>
11+
12+
<!-- Firefox -->
1113
<em:targetApplication>
1214
<Description>
1315
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
1416
<em:minVersion>6.0</em:minVersion>
1517
<em:maxVersion>14.0a1</em:maxVersion>
1618
</Description>
1719
</em:targetApplication>
20+
21+
<!-- SeaMonkey -->
22+
<em:targetApplication>
23+
<Description>
24+
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
25+
<em:minVersion>2.1.*</em:minVersion>
26+
<em:maxVersion>2.9.*</em:maxVersion>
27+
</Description>
28+
</em:targetApplication>
1829
<em:bootstrap>true</em:bootstrap>
1930
<em:creator>Mozilla</em:creator>
2031
<em:description>Uses HTML5 to display PDF files directly in Firefox.</em:description>

0 commit comments

Comments
 (0)