Merge pull request #3018 from Snuffleupagus/detect-colors-disabled
Detect and add fallback if document colors are disabled in Firefox
This commit is contained in:
commit
55d850eb42
@ -383,6 +383,9 @@ ChromeActions.prototype = {
|
|||||||
var prefGfx = getBoolPref('gfx.downloadable_fonts.enabled', true);
|
var prefGfx = getBoolPref('gfx.downloadable_fonts.enabled', true);
|
||||||
return (!!prefBrowser && prefGfx);
|
return (!!prefBrowser && prefGfx);
|
||||||
},
|
},
|
||||||
|
supportsDocumentColors: function() {
|
||||||
|
return getBoolPref('browser.display.use_document_colors', true);
|
||||||
|
},
|
||||||
fallback: function(url, sendResponse) {
|
fallback: function(url, sendResponse) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var domWindow = this.domWindow;
|
var domWindow = this.domWindow;
|
||||||
|
@ -123,3 +123,4 @@ request_password=PDF is protected by a password:
|
|||||||
printing_not_supported=Warning: Printing is not fully supported by this browser.
|
printing_not_supported=Warning: Printing is not fully supported by this browser.
|
||||||
printing_not_ready=Warning: The PDF is not fully loaded for printing.
|
printing_not_ready=Warning: The PDF is not fully loaded for printing.
|
||||||
web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts.
|
web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts.
|
||||||
|
web_colors_disabled=Web colors are disabled.
|
||||||
|
@ -122,4 +122,5 @@ request_password=PDF-filen är lösenordsskyddad:
|
|||||||
|
|
||||||
printing_not_supported=Varning: Utskrifter stöds inte fullt ut av denna webbläsare.
|
printing_not_supported=Varning: Utskrifter stöds inte fullt ut av denna webbläsare.
|
||||||
printing_not_ready=Varning: Hela PDF-filen måste laddas innan utskrift kan ske.
|
printing_not_ready=Varning: Hela PDF-filen måste laddas innan utskrift kan ske.
|
||||||
web_fonts_disabled=Webbtypsnitt är inaktiverade: Typsnitt inkluderade i PDF-filer kan ej användas.
|
web_fonts_disabled=Webbtypsnitt är inaktiverade: Typsnitt inbäddade i PDF-filer kan ej användas.
|
||||||
|
web_colors_disabled=Webbfärger är inaktiverade.
|
||||||
|
@ -922,6 +922,19 @@ var PDFView = {
|
|||||||
return support;
|
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() {
|
get isHorizontalScrollbarEnabled() {
|
||||||
var div = document.getElementById('viewerContainer');
|
var div = document.getElementById('viewerContainer');
|
||||||
return div.scrollWidth > div.clientWidth;
|
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.'));
|
// 'Web fonts are disabled: unable to use embedded PDF fonts.'));
|
||||||
// PDFView.fallback();
|
// 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
|
//#endif
|
||||||
if (error) {
|
if (error) {
|
||||||
PDFView.error(mozL10n.get('rendering_error', null,
|
PDFView.error(mozL10n.get('rendering_error', null,
|
||||||
|
Loading…
Reference in New Issue
Block a user