mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Switch to constant for max database length.
This commit is contained in:
parent
1af9a72011
commit
b867aa9922
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ const Cu = Components.utils;
|
||||||
const PDFJS_EVENT_ID = 'pdf.js.message';
|
const PDFJS_EVENT_ID = 'pdf.js.message';
|
||||||
const PDF_CONTENT_TYPE = 'application/pdf';
|
const PDF_CONTENT_TYPE = 'application/pdf';
|
||||||
const EXT_PREFIX = 'extensions.uriloader@pdf.js';
|
const EXT_PREFIX = 'extensions.uriloader@pdf.js';
|
||||||
|
const MAX_DATABASE_LENGTH = 4096;
|
||||||
|
|
||||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
Cu.import('resource://gre/modules/Services.jsm');
|
Cu.import('resource://gre/modules/Services.jsm');
|
||||||
|
@ -51,7 +52,7 @@ ChromeActions.prototype = {
|
||||||
if (this.inPrivateBrowswing)
|
if (this.inPrivateBrowswing)
|
||||||
return;
|
return;
|
||||||
// Protect against something sending tons of data to setDatabase.
|
// Protect against something sending tons of data to setDatabase.
|
||||||
if (data.length > 4096)
|
if (data.length > MAX_DATABASE_LENGTH)
|
||||||
return;
|
return;
|
||||||
application.prefs.setValue(EXT_PREFIX + '.database', data);
|
application.prefs.setValue(EXT_PREFIX + '.database', data);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue