mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Detect and add fallback if document colors are disabled in Firefox - address comment
This commit is contained in:
parent
6ad7bd6be8
commit
ee83df1338
4 changed files with 25 additions and 1 deletions
|
@ -922,6 +922,19 @@ var PDFView = {
|
|||
return support;
|
||||
},
|
||||
|
||||
get supportsDocumentColors() {
|
||||
var support = true;
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
//#else
|
||||
// support = FirefoxCom.requestSync('supportsDocumentColors');
|
||||
//#endif
|
||||
Object.defineProperty(this, 'supportsDocumentColors', { value: support,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: false });
|
||||
return support;
|
||||
},
|
||||
|
||||
get isHorizontalScrollbarEnabled() {
|
||||
var div = document.getElementById('viewerContainer');
|
||||
return div.scrollWidth > div.clientWidth;
|
||||
|
@ -2263,6 +2276,12 @@ var PageView = function pageView(container, id, scale,
|
|||
// 'Web fonts are disabled: unable to use embedded PDF fonts.'));
|
||||
// PDFView.fallback();
|
||||
// }
|
||||
// if (self.textLayer && self.textLayer.textDivs.length &&
|
||||
// !PDFView.supportsDocumentColors) {
|
||||
// console.error(mozL10n.get('web_colors_disabled', null,
|
||||
// 'Web colors are disabled.'));
|
||||
// PDFView.fallback();
|
||||
// }
|
||||
//#endif
|
||||
if (error) {
|
||||
PDFView.error(mozL10n.get('rendering_error', null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue