mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Detecting if web fonts are disable in Firefox.
This commit is contained in:
parent
223ad0c117
commit
5dc87a7fca
4 changed files with 49 additions and 0 deletions
|
@ -71,6 +71,14 @@ function getBoolPref(pref, def) {
|
|||
}
|
||||
}
|
||||
|
||||
function getIntPref(pref, def) {
|
||||
try {
|
||||
return Services.prefs.getIntPref(pref);
|
||||
} catch (ex) {
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
function setStringPref(pref, value) {
|
||||
let str = Cc['@mozilla.org/supports-string;1']
|
||||
.createInstance(Ci.nsISupportsString);
|
||||
|
@ -351,6 +359,10 @@ ChromeActions.prototype = {
|
|||
getChromeWindow(this.domWindow).gFindBar &&
|
||||
'updateControlState' in getChromeWindow(this.domWindow).gFindBar;
|
||||
},
|
||||
supportsDocumentFonts: function() {
|
||||
var pref = getIntPref('browser.display.use_document_fonts', 1);
|
||||
return !!pref;
|
||||
},
|
||||
fallback: function(url, sendResponse) {
|
||||
var self = this;
|
||||
var domWindow = this.domWindow;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue