Remove the supportsDocumentColors
warning in MOZCENTRAL builds (bug 844349 follow-up)
With https://bugzilla.mozilla.org/show_bug.cgi?id=844349 now being fixed in Firefox, the textLayer will now actually stay hidden as intended regardless of the browser settings. Hence it should no longer be necessary to display the fallback bar, nor print a warning in the console, for documents which contains a textLayer. Besides removing the `supportsDocumentColors` methods in the default viewer, we can also remove a now unused l10n string.
This commit is contained in:
parent
1b87b1c384
commit
a977882f54
@ -245,4 +245,3 @@ password_cancel=Cancel
|
||||
printing_not_supported=Warning: Printing is not fully supported by this browser.
|
||||
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.
|
||||
document_colors_not_allowed=PDF documents are not allowed to use their own colors: “Allow pages to choose their own colors” is deactivated in the browser.
|
||||
|
32
web/app.js
32
web/app.js
@ -119,10 +119,6 @@ class DefaultExternalServices {
|
||||
return shadow(this, "supportsDocumentFonts", true);
|
||||
}
|
||||
|
||||
static get supportsDocumentColors() {
|
||||
return shadow(this, "supportsDocumentColors", true);
|
||||
}
|
||||
|
||||
static get supportedMouseWheelZoomModifierKeys() {
|
||||
return shadow(this, "supportedMouseWheelZoomModifierKeys", {
|
||||
ctrlKey: true,
|
||||
@ -570,10 +566,6 @@ const PDFViewerApplication = {
|
||||
return this.externalServices.supportsDocumentFonts;
|
||||
},
|
||||
|
||||
get supportsDocumentColors() {
|
||||
return this.externalServices.supportsDocumentColors;
|
||||
},
|
||||
|
||||
get loadingBar() {
|
||||
const bar = new ProgressBar("#loadingBar");
|
||||
return shadow(this, "loadingBar", bar);
|
||||
@ -1609,7 +1601,6 @@ const PDFViewerApplication = {
|
||||
eventBus.on("beforeprint", _boundEvents.beforePrint);
|
||||
eventBus.on("afterprint", _boundEvents.afterPrint);
|
||||
eventBus.on("pagerendered", webViewerPageRendered);
|
||||
eventBus.on("textlayerrendered", webViewerTextLayerRendered);
|
||||
eventBus.on("updateviewarea", webViewerUpdateViewarea);
|
||||
eventBus.on("pagechanging", webViewerPageChanging);
|
||||
eventBus.on("scalechanging", webViewerScaleChanging);
|
||||
@ -1684,7 +1675,6 @@ const PDFViewerApplication = {
|
||||
eventBus.off("beforeprint", _boundEvents.beforePrint);
|
||||
eventBus.off("afterprint", _boundEvents.afterPrint);
|
||||
eventBus.off("pagerendered", webViewerPageRendered);
|
||||
eventBus.off("textlayerrendered", webViewerTextLayerRendered);
|
||||
eventBus.off("updateviewarea", webViewerUpdateViewarea);
|
||||
eventBus.off("pagechanging", webViewerPageChanging);
|
||||
eventBus.off("scalechanging", webViewerScaleChanging);
|
||||
@ -2025,28 +2015,6 @@ function webViewerPageRendered(evt) {
|
||||
}
|
||||
}
|
||||
|
||||
function webViewerTextLayerRendered(evt) {
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("FIREFOX || MOZCENTRAL") &&
|
||||
evt.numTextDivs > 0 &&
|
||||
!PDFViewerApplication.supportsDocumentColors
|
||||
) {
|
||||
PDFViewerApplication.l10n
|
||||
.get(
|
||||
"document_colors_not_allowed",
|
||||
null,
|
||||
"PDF documents are not allowed to use their own colors: " +
|
||||
"'Allow pages to choose their own colors' " +
|
||||
"is deactivated in the browser."
|
||||
)
|
||||
.then(msg => {
|
||||
console.error(msg);
|
||||
});
|
||||
PDFViewerApplication.fallback();
|
||||
}
|
||||
}
|
||||
|
||||
function webViewerPageMode({ mode }) {
|
||||
// Handle the 'pagemode' hash parameter, see also `PDFLinkService_setHash`.
|
||||
let view;
|
||||
|
@ -343,11 +343,6 @@ class FirefoxExternalServices extends DefaultExternalServices {
|
||||
return shadow(this, "supportsDocumentFonts", support);
|
||||
}
|
||||
|
||||
static get supportsDocumentColors() {
|
||||
const support = FirefoxCom.requestSync("supportsDocumentColors");
|
||||
return shadow(this, "supportsDocumentColors", support);
|
||||
}
|
||||
|
||||
static get supportedMouseWheelZoomModifierKeys() {
|
||||
const support = FirefoxCom.requestSync(
|
||||
"supportedMouseWheelZoomModifierKeys"
|
||||
|
Loading…
x
Reference in New Issue
Block a user